Membulatkan suatu bilangan menjadi sejumlah digit tertentu
=ROUND(number, num_digits)
| Parameter | Deskripsi |
|---|---|
number |
The number to round. |
num_digits |
The place at which number should be rounded. |
We can get the same result with the ROUND function by providing 1 as num_digits:
=ROUND(2.786,1) // returns 2.8
To round values to the right of the decimal point, use a positive number for digits:
=ROUND(A1,1) // Round to nearest tenth (0.1)
=ROUND(A1,2) // Round to nearest hundredth (0.01)
=ROUND(A1,3) // Round to nearest thousandth (0.001)
=ROUND(A1,4) // Round to nearest ten-thousandth (0.0001)
To round down values to the left of the decimal point, use zero or a negative number for digits:
=ROUND(A1,0) // Round to nearest whole number
=ROUND(A1,-1) // Round to nearest 10
=ROUND(A1,-2) // Round to nearest 100
=ROUND(A1,-3) // Round to nearest 1000
=ROUND(A1,-4) // Round to nearest 10000
Other operations and functions can be nested inside the ROUND function. For example, to round down the result of A1 divided by B1, you can ROUND in a
=ROUND(A1/B1,0) // round result to nearest integer