Trunc

This function truncates the decimal position of a floating point number:

  • If the floating number belongs to the number range of 2147483647 to -2147483648, you need to type cast the return value to integer.
  • If the floating number belongs to the number range of 2147483648 to 9223372036854775807 and -2147483649 to -9223372036854775808, you need to type cast the return value to big integer.

SYNTAX
Trunc(value)
ARGUMENTS value Floating point number
RETURN Integer
EXAMPLE
d = 1.9

i = Integer(Trunc(d))

;--> i = 1

d = 9999999999.001

i = BigInteger(Trunc(d))

;--> i = 9999999999