Navigation: Developing Apps > BINETIX® AGE™ API > The Node > Toolkits > age_math
trunc/2
Description
trunc/2 is an Erlang function exported by "age_math" module.
Returns an integer by truncating an input floating point value. Optionally you can set the truncating precision.
References
•trunc/2
Parameters
Name
Type
Number
number()
Input floating point value
Precision
integer()
Optional. Precision limit set as number of digits after the floating point.
Result
Value or Type
Returns an integer by truncating Number
Code Sample
> age_math:trunc(123.456, 2). 123.45