Memotong angka hingga presisi tertentu
=TRUNC(number, [num_digits])
| Parameter | Deskripsi |
|---|---|
number |
The number to truncate. |
num_digits |
[optional] The precision of the truncation (default is 0). |
By default, TRUNC will return the integer portion of a number:
=TRUNC(4.9) // returns 4
=TRUNC(-3.5) // returns -3
To control the place at which number is truncated, provide a value for num_digits.
=TRUNC(3.141593) // returns 3
=TRUNC(3.141593,0) // returns 3
=TRUNC(3.141593,1) // returns 3.1
=TRUNC(3.141593,2) // returns 3.14
=TRUNC(3.141593,3) // returns 3.141
When num_digits is negative, the TRUNC function will replace the number at a given place with zero:
=TRUNC(999.99,0) // returns 999
=TRUNC(999.99,-1) // returns 990
=TRUNC(999.99,-2) // returns 900