Link Search Menu Expand Document

roundm

Explanation Rounds the original value to be a multiple of the specified value.
If you specify a value greater than 0 for the rounding method, it will be rounded up.
If 0 is specified or omitted for the rounding method, rounding is performed.
If you specify a negative number for the rounding method, it will be rounded down.
*Added since Mobile Version 2.0.0*
Call format var r = roundm( arg, n, m )
Return value Returns a number rounded to a multiple of the specified value.
Arguments Number arg Original number
Number n Numerical value for rounding
Number m Rounding method
Exception None
Example of use
var b;
b = 50.67;
a = roundm(b, 10, 1);  /* aは60となる */
a = roundm(b, 10);     /* aは50となる */
a = roundm(b, 10, -1); /* aは50となる */
Related item round, rounddown, roundup methods