MNumber

Loaded from
core/util/MNumber

Public Methods



random($min:Number, $max:Number, $decimal_points:int):Number


Generates a random number between the $min and $max variables passed in. Unlike the default PHP rand() function this function returns floating point numbers. The third parameter allows you to specify how many decimal points you want. By default 5 decimal points are returned.

MNumber::random(0, 100); 
float(91.96005)

to_boolean($value:Number):Boolean


Converts a number to a boolean. 1 or greater returns a boolean of TRUE. 0 or less than returns a boolean of FALSE.