Rounds a number towards 0.

This function is valid in v2.0.0 to v2.14.0. This function has been downloaded 48 times.


{number} num
Number to round towards 0.
{number=} opt_precision Optional
The precision (as an integer) with which to round the number towards 0.


num rounded towards 0.

Required Functions

This function requires the following functions which are included automatically:

  • ceil()
    Rounds towards Infinity with the specified precision.
  • floor()
    Rounds towards -Infinity with the specified precision.
  • roundOut()
    Rounds a number towards 0.