Skip to content

Flow documentation · legacy product

FloCurrStrToFloat ​

Declaration ​

Function FloCurrStrToFloat( const S : string) : Extended

Example ​

pascal
procedure OnMapEvent(var Value:Variant);
var MyAmount : String
begin
MyAmount := '$1,234.567';
Value := FloCurrStrToFloat(MyAmount); //Value will be equal to 1234.567
end;

Description ​

FloCurrStrToFloat converts a string containing numeric and currency characters into a Float data type, by removing the non-numeric characters. If the remaining characters do not represent a valid numeric value an error will occur.

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

(This page corrected in November 2018 to include "Flo" at the beginning of the function name.)