frac(x)

x = Any number

 

Returns the fractional part of x, that is the part behind the dot. If there is nothing behind the dot it returns 0. It the number is negative, the result of this function is also negative.

 

Example #1:

num = -45.23;

show_message(string(frac(num))); //shows -0.23

 

num = 98.62;

show_message(string(frac(num))); //shows 0.62.

 

num = 46;

show_message(string(frac(+num))); //shows 0

 

tsg1zzn - Revision #1