The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Class: none
Declaration: function IsValidFPNum (Instring: string; DecSeparator: TDecPSep): boolean;

The function IsValidFPNum checks whether the string Instring contains a valid floating point number. Valid characters are the digits 0...9, ., ',' and leading - and + signs. The decimal separator can be controlled by the parameter DecSeparator:
dsDot the "." character (dot)
dsComma the "," character (comma)
dsBoth allows both the dot and the comma character
dsSystem the decimal separator is taken from the system locale

Hint: The function IsValidFPNum is similar to IsValidDouble except for the fact that it does neither allow exponential notation nor leading blanks.

Example: The strings '13945,092' and '13945.092' are valid floating point numbers if the parameter DecSeparator is set to dsBoth, the string '13,945.092' is not a valid floating point number (group separators are not allowed).

Last Update: 2012-Oct-20