Skip to content

Flow documentation · legacy product

StrToFloat ​

Declaration ​

Function StrToFloat( const S : string) : Extended

Example ​

pascal
procedure OnMapEvent(var Value:Variant);
var MyAmount : String
begin
MyAmount := '123.3456';
Value := StrToFloat(MyAmount); //Value will be equal to 123.3456
end;

Description ​

StrToFloat converts a string into a Float data type. If string does not contain a numeric value an error will occur. If the value contains currency formatting then use FloCurrStrToFloat function.

You could use a Try...Except block to handle the error and provide a default value.