Function reference

Truncates a number to the specified number of decimal places.

Truncate ( x, n )

Argument Description
x The number you want to truncate.
n The number of decimal places to which you want to truncate x. Valid values are 0 through 28.

Data type: Number
If n is positive, returns x truncated to the specified number of decimal places. If n is negative, returns x truncated to (- n +1) places before the decimal point.

Example 1
This expression returns 9.2
Truncate(9.22, 1)

Example 2
This expression returns 9.2
Truncate(9.28, 1)

Example 3
This expression returns 9
Truncate(9.9, 0)

Example 4
This expression returns -9.2
Truncate(–9.29, 1)

Example 5
This expression returns 0
Truncate(9.2, –1)

Example 6
This expression returns 50
Truncate(54, –1)


Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment