IsFloat()

Namespace ›› System ›› Mfunc ›› Methods ››
Parent Previous Next

IsFloat()

OutputVar := Mfunc.IsFloat(num)

Mfunc.IsFloat(num)

Checks to see if a param num is Float.

Parameters

num

A var to check to see if it contains a float

Returns

Returns true if num is non-empty and contains a floating point number; that is, a purely numeric string containing a decimal point. Leading and trailing spaces and tabs are allowed. The string may start with a plus sign, minus sign, or decimal point; Otherwise false is returned.

Remarks

Static method
String Values containing numbers such as "100.0" and "0.0" will return true However "100" will return false.

Related

IsInteger(), IsNumeric(), MfFloat, MfInteger, MfInt64, MfByte

Example

MsgBox % Mfunc.IsFloat(100)     ; Displays 0 for false
MsgBox % Mfunc.IsFloat(100.0)   ; Displays 1 for true
MsgBox % Mfunc.IsFloat(-100)    ; Displays 0 for false
MsgBox % Mfunc.IsFloat(-100.0)  ; Displays 1 for true
MsgBox % Mfunc.IsFloat(+100.0)  ; Displays 1 for true
MsgBox % Mfunc.IsFloat("100")   ; Displays 0 for false
MsgBox % Mfunc.IsFloat(0x100A)  ; Displays 0 for false
MsgBox % Mfunc.IsFloat("100.0") ; Displays 1 for true
MsgBox % Mfunc.IsFloat(10.5)    ; Displays 1 for true
MsgBox % Mfunc.IsFloat(0.25)    ; Displays 1 for true
MsgBox % Mfunc.IsFloat(.25)     ; Displays 1 for true
MsgBox % Mfunc.IsFloat(0.0)     ; Displays 1 for true
MsgBox % Mfunc.IsFloat(.0)      ; Displays 1 for true