Available in all subroutines.
x to an integer value less than or equal in absolute value.
In other words, round
x towards zero. Negative values will be rounded up
towards zero and positive values will be rounded down towards zero.
For example, 2.2, 2.5, and 2.7 all truncate to 2.0.
This is equivalent to formatting the number to base ten and removing all digits after the decimal point.
math.NAN, a NaN will be returned.
x is integral, ±0,
x itself is returned.
Otherwise, the rounded value of
x is returned.
User contributed notes
We welcome comments that add use cases, ideas, tips, and caveats. All comments will be moderated before publication. To post support questions, visit our support center and we'll find you the help you need.