frac

Returns the decimal part of the given number.

Syntax:

frac(n);


Argument Description
n The number to change.


Returns: Real


Description

This function returns the fractional part of n, that is, the part behind the decimal dot. It will return only the decimals behind the dot of a value, so frac(3.125) will return 0.125, frac(6.921) will return 0.921, etc...


Example:

val = frac(3.4);

This will set val to 0.4.


Back: Real Number Functions
Next: abs
© Copyright YoYo Games Ltd. 2018 All Rights Reserved