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

AVEVA™ InTouch HMI

StringToReal()

  • Last UpdatedSep 24, 2024
  • 1 minute read

将字符串的数字值转换为实型(浮点)值,并返回结果。

类别

字符串型

语法

RealResult = StringToReal( Text );

参数

文本

函数处理的字符串。实际字符串或字符串属性。

附注

对此语句求值时,系统会读取字符串的第一个字符作为数字值。如果第一个字符不是数字(空格会被忽略),则会将字符串求值为零 (0)。如果发现第一个字符是数字,则系统会继续读取后续字符,直到遇到非数字值。

示例

StringToReal("ABCD"); ‘ 返回 0;

StringToReal("22.261 is the value"); ‘ 返回 22.261;

StringToReal("The Value is 2"); ‘ 返回 0;

另请参阅

StringASCII()

StringChar()

StringFromIntg()

StringFromReal()

StringFromTime()

StringInString()

StringLeft()

StringLen()

StringLower()

StringMid()

StringReplace()

StringRight()

StringSpace()

StringTest()

StringToIntg()

StringTrim()

StringUpper()

Text()

In This Topic
Related Links