truncate

Use the truncate function to adjust a number to the indicated precision by discarding any remaining fractional part. This function always adjusts numbers toward zero.

 truncate ( input; precision )

This function returns a value of type NUMBER.

The function has two parameters:

  1. input, type NUMBER. The number to round.
  2. precision, type NUMBER. The number of significant decimals (up to 9 decimals is supported).

This function treats positive and negative values symmetrically.

Examples

truncate (12.324; 0) results in 12

truncate (12 ; 2) results in 12

truncate (12.324; 2) results in 12.32

truncate (12.325; 2) results in 12.32

truncate (-12.324; 2) results in -12.32

truncate (-12.325; 2) results in -12.32