List of methods for float values variables¶
List of methods for float. Consider name of variable is f
and value is 12.50
for all examples.
ToString()
¶
Returns the value of the variable in string. Example:
f.ToString().Value //returns "12.5"
f.ToString().ReplaceAll('1','0').Value //returns "02.5"
ToFloat()
¶
Returns the value of the variable in int type. Used for convert to do operations with int variables. Example:
f.ToInt().Value //returns 12
Ceil()
¶
Returns the value of the variable in int type rounded up. Example:
f.Ceil().Value //returns 13
Floor()
¶
Returns the value of the variable in int type rounded down. Example:
f.Floor().Value //returns 11
ToBool()
¶
Returns a bool. If f
value is 1
returns true
, otherwise false
. Example:
f.ToBool().Value //returns false
ToStringDecimal(n int)
¶
Returns a string of float
with fixed decimal points defined in n
. Example:
f.ToStringDecimal(3).Value //returns "12.500"