LaoUrl is a collection of math functions. It is intended to provide additional features that the default Math Object does not have. This class shouldn't be instantiated
static public function round(qnum:Number, qdecimal:Number, qdecimalmin:Number):NumberRound a number to a specific number of decimal places.
var num:Number=LaoMath.round(1.535,1); //returns 1.5 var num2:Number=LaoMath.round(1.535,1,2); //returns 1.50or (if the qdecimal number is negative) aproximate it to the closest group of ten, group of 100, group of 1000, etc
var num:Number=LaoMath.round(1535.51,-1); //returns 1540 var num2:Number=LaoMath.round(1.51,-1,2); //returns 1540.00 var num2:Number=LaoMath.round(1.51,-2,2); //returns 0.00
qnum | Number to be rounded |
qdecimal | Number of decimal places |
qdecimalmin | [optional] Minimum number of decimal places to display (if necessary, it'll add trailing zeros). Important: As it is the minimum, this parameter will get ignored if qdecimal is greater than qdecimalmin |
a rounded number to a specific number of decimal places [with optional trailing zeros]