Rounding to an integer

Mondo Workplace Updated on 2024-02-01

Here are a few examples of rounding functions:

1.round function

The round function rounds the number to a specified number of digits or the nearest integer. For example, to add the number 314159 is rounded to two decimal places, the following formula can be used:

round(3.14159, 2)

The result is 314。

If you want to add the number -314159 is rounded to the nearest whole number, you can use the following formula:

round(-3.14159, 0)

The result is 3

2.int function

The int function can be used to round down, that is, to truncate the number to an integer. For example, to add the number 78 Rounded to the nearest integer, the following formula can be used:

int(7.8)

The result was 7. If you want to add the number -78 Rounded to the nearest integer, the following formula can be used:

int(-7.8)

The result is -8.

3.mround function

The mround function is a new function in Excel 2013 and later that rounds numbers in monetary terms. For example, to add the number $123456 rounded to the nearest cent, the following formula can be used:

mround($1234.56, 2) The result is $123456。If you want to put the number $-123456 rounded to the nearest cent, the following formula can be used:

mround(-1234.56, 2)

The result is $-123456$。

Related Pages