Difference between revisions of "Manuals/calci/MROUND"
Jump to navigation
Jump to search
Line 20: | Line 20: | ||
*The number is rounded up or down, depending on the remainder of division of the number and the multiple. If the remainder is more than or equal to half the multiple value, the number is rounded up, else it is rounded down towards zero. | *The number is rounded up or down, depending on the remainder of division of the number and the multiple. If the remainder is more than or equal to half the multiple value, the number is rounded up, else it is rounded down towards zero. | ||
*Calci returns an NaN error message if any argument is nonnumeric or omitted. | *Calci returns an NaN error message if any argument is nonnumeric or omitted. | ||
− | *Calci returns an #ERROR message if 'number' and ' | + | *Calci returns an #ERROR message if 'number' and 'multiple' have different signs. |
*If the number is an exact multiple, rounding will not be done. Calci will display the same number as output. | *If the number is an exact multiple, rounding will not be done. Calci will display the same number as output. | ||
Line 60: | Line 60: | ||
|- class="odd" | |- class="odd" | ||
− | | class="sshl_f" | MROUND(3. | + | | class="sshl_f" | MROUND(3.67,2) |
− | | class="sshl_f" | | + | | class="sshl_f" | 4 |
|- class="even" | |- class="even" | ||
− | | class="sshl_f" | MROUND(99 | + | | class="sshl_f" | MROUND(99,3) |
| class="sshl_f" | 99 | | class="sshl_f" | 99 | ||
|- class="odd" | |- class="odd" | ||
− | | class="sshl_f" | MROUND( | + | | class="sshl_f" | MROUND(4.35,0.01) |
− | + | | class="sshl_f" | 4.35 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | class="sshl_f" | | ||
|- class="even" | |- class="even" | ||
− | | class="sshl_f" | MROUND(-89.65,- | + | | class="sshl_f" | MROUND(-89.65,-3) |
| class="sshl_f" | -90 | | class="sshl_f" | -90 | ||
|} | |} |
Revision as of 16:03, 3 December 2013
MROUND(number, multiple)
- Where 'number' is the number to round and
- 'multiple' is the multiple value to which number is to be rounded.
MROUND() rounds a number to specified multiple.
Description
MROUND(number, multiple)
This function is used to round a number up or down depending on the multiple value.
For Example,
MROUND(3.6, 2) returns 4 as a result.
MROUND(44.1, 4) returns 44 as a result.
- The number is rounded up or down, depending on the remainder of division of the number and the multiple. If the remainder is more than or equal to half the multiple value, the number is rounded up, else it is rounded down towards zero.
- Calci returns an NaN error message if any argument is nonnumeric or omitted.
- Calci returns an #ERROR message if 'number' and 'multiple' have different signs.
- If the number is an exact multiple, rounding will not be done. Calci will display the same number as output.
MROUND() can also be used for multiple number array as -
MROUND(2.5..7.5, 2) that rounds the numbers from 2.5 to 7.5 to nearest multiple of 2.
Number | Multiple | MROUND |
---|---|---|
2.5 | 2 | 2 |
3.5 | 2 | 4 |
4.5 | 2 | 4 |
5.5 | 2 | 6 |
6.5 | 2 | 6 |
7.5 | 2 | 8 |
- ROUND() can be used to round a number to specified number of digits.
- ROUNDUP() can be used to round a number away from zero.
- ROUNDDOWN() can be used to round a number towards zero.