round()

Rounds with the specified precision.

This function is valid in v2.0.0 to v2.24.3. This function has been downloaded 60 times.

Parameters

{number} num
The number to be rounded.
{number=} opt_precision Optional
The precision (as an integer) with which to round the number. Using the precision is similar to doing Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision).

Returns

{number}
Returns num rounded with the specified precision.

Required Functions

This function directly requires the following functions which are included automatically:

  • ceil()
    Rounds towards Infinity with the specified precision.
  • floor()
    Rounds towards -Infinity with the specified precision.

Requiring Functions

This function is directly required by the following functions:

  • ceil()
    Rounds towards Infinity with the specified precision.
  • floor()
    Rounds towards -Infinity with the specified precision.