Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

StrToReal

  • Last UpdatedJul 18, 2023
  • 1 minute read

Converts a string into a floating-point number. This function will search the string for the first non-blank character, and then start converting until it finds the end of the string or a non-numeric character. If the first non-blank character is not a numeric character (0-9), a space, a decimal point, a " + " or a " - " sign, the return value is 0 (zero).

Syntax

StrToReal(String)

String:

The string to convert.

Return Value

A floating-point number (converted from String).

StrToInt, StrToValue

Example

Variable=StrToReal("45");

! Sets Variable to 45.

Variable=StrToReal("45.23");

! Sets Variable to 45.23

Variable=StrToReal("A45");

! Sets Variable to 0.

See Also

String Functions

Using the Caret Escape Sequence Character

Converting and Formatting Cicode Variables

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in