Math.trunc()
Truncate a number to a given precision.
Description
Gets the number x truncated to precision, depending on the underlying representation of the floating point number.
Examples
Math.trunc(12.123, 1)
12.1
Note that the result might reflect the underlying imprecision of the representation of a floating point number:
Math.trunc(12.123, 3)
12.122
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!