Mark Lazarides
Mark Lazarides

Reputation: 376

REAL / LREAL to String with Scientific Notation Structured Text

I am looking for a way to convert a floating-point value to scientific notaiton string in Beckhoff TwinCAT or codesys. The documentation for their FB_FormatString says this is not currently supported. Does anyone have a "goto" approach for this?

Upvotes: 2

Views: 1155

Answers (1)

Peter Zerlauth
Peter Zerlauth

Reputation: 36

In TwinCAT I use LREAL_TO_FMTSTR

sOut := LREAL_TO_FMTSTR( 0.46523, 2, TRUE );

Upvotes: 2

Related Questions