Methods
-
<static> ceil10(value, exp)
-
A ceiling function allowing for more discrete control over the rounding location.
Parameters:
Name Type Description value
Number The value on which you want to perform the ceiling.
exp
Number The exponent of 10 marking the location from which to perform the ceiling. ceil10(456, 2) will round up to 500.
Returns:
The ceiled value (500 in the case above)
- Type
- Number
-
<static> disableCeil10()
-
Detaches the ceil10 function from the Math global.
-
<static> disableFloor10()
-
Detaches the floor10 function from the Math global.
-
<static> disableRound10()
-
Detaches the round10 function from the Math global.
-
<static> enableAll()
-
Throws:
-
If Math has already implemented any of the above functions
- Type
- Error
-
-
<static> enableCeil10()
-
Attaches the ceil10 function to the Math global.
Throws:
-
If Math has already implemented ceil10
- Type
- Error
-
-
<static> enableFloor10()
-
Attaches the floor10 function to the Math global.
Throws:
-
If Math has already implemented floor10.
- Type
- Error
-
-
<static> enableRound10()
-
Attaches the round10 function to the Math global.
Throws:
-
If Math has already implemented round10
- Type
- Error
-
-
<static> floor10(value, exp)
-
A floor function allowing for more discrete control over the rounding location.
Parameters:
Name Type Description value
Number The value on which you want to perform the floor.
exp
Number The exponent of 10 marking the location from which to perform the floor. floor10(987, 2) will round down to 900.
Returns:
The floored value (900 in the case above)
- Type
- Number
-
<static> round10(value, exp)
-
A rounding function allowing for more discrete control over the rounding location.
Parameters:
Name Type Description value
Number The value on which you want to perform the round.
exp
Number The exponent of 10 marking the location from which to perform the round. round10(1251, 2) will round up to 1300.
Returns:
The rounded value (1300 in the case above)
- Type
- Number
-
<inner> decimalAdjust(type, value, exp)
-
Decimal adjustment of a number.
Parameters:
Name Type Description type
String The type of adjustment.
value
Number The number.
exp
Integer The exponent (the 10 logarithm of the adjustment base).
Returns:
The adjusted value.
- Type
- Number