STRING::ISFLOAT 1g 2024-04-10 laplante@plcb.ca GOWEB/STRING — Check for Floating-Point Number


title: “STRING::ISFLOAT” version: “1.0.0” date: 2024-04-10 author: “laplante@plcb.ca” section: “1g”

category: “GOWEB/STRING”

Name

string::isfloat Check for Floating-Point Number

Synopsis

string::isfloat(string[, error: variable, string...])
isfloat(string[, error: variable, string...])

Description

The isfloat function checks whether the provided string represents a valid floating-point number.
It supports:

If the string cannot be parsed as a valid float, the function returns false.


Examples

res={{
    isfloat(123); "\n";
    isfloat(3.1415926535); "\n";
    isfloat("3.1415926535"); "\n";
    isfloat("3.14159.26535"); "\n";
    isfloat("45.65"); "\n";
    isfloat(".65"); "\n";
    isfloat("4."); "\n";
    isfloat("4"); "\n";
    isfloat("+4.."); "\n";
    isfloat("+."); "\n";
    isfloat("."); "\n";
    isfloat(""); "\n";
}}.

Returns:

res=true
true
true
false
true
true
true
true
false
false
false
false

Author

laplante@plcb.ca

See Also


Version