Float

Converts a value to a floating-point variable. The value used must be in a number format.

SYNTAX
Float(valueToConvert)
ARGUMENTS valueToConvert The variable to convert

  • If the parameter is a string or a constant, the period is always the decimal separator. The thousands separator is always a comma.
  • If a variable is passed to Float, the content is interpreted according to the Windows regional settings for DecimalSeparator and ThousandSeparator.

If an empty string is passed as the parameter value, it results in an exception at runtime.
RETURN Floating-point variable

Example

FloatVar = Float("9.15")           ;FloatVar = 9.15

FloatVar = Float("9,000.15")       ;FloatVar = 9000.15

FloatVar = Float("11,0.15")        ;FloatVar = 110.15

;

Test = "9.15"

FloatVar = Float(Test)            ;result depends on the windows regional settings, in Germany FloatVar = 915

;

Test = "9,15"

FloatVar = Float(Test)           ;result depends on the windows regional settings, in Germany FloatVar = 9,15