ROUNDUP
A number rounded away from zero to a number of decimals.
Group: Math. Compatible with DAX.
Syntax
ROUNDUP ( <number>, <num_digits> )
| Parameter | Type | Description |
|---|---|---|
number | Number | The number that goes up. |
num_digits | Whole number | How many decimals to keep: 0 for a whole number, a negative number for tens, hundreds and so on. |
Returns
Number. The number rounded away from zero to that many decimals.
Remarks
- Away from zero means that negative numbers get more negative:
ROUNDUP ( -3.21, 1 )is -3.3. To round towards plus infinity, useCEILINGorISO.CEILING. - A number that already has no more decimals stays as it is:
ROUNDUP ( 3.0, 0 )is 3,ROUNDUP ( 3.0001, 0 )is 4. - The last-digit noise of floating point does not push a number up: 0.1 + 0.2 is held as 0.30000000000000004, yet
ROUNDUP ( 0.1 + 0.2, 1 )is 0.3. - A blank gives BLANK.
Examples
Up, away from zero
EVALUATE
ROW (
"3.21 to 1", ROUNDUP ( 3.21, 1 ),
"-3.21 to 1", ROUNDUP ( -3.21, 1 ),
"1201 to -2", ROUNDUP ( 1201, -2 ),
"3.0001 to 0", ROUNDUP ( 3.0001, 0 )
)
| 3.21 to 1 | -3.21 to 1 | 1201 to -2 | 3.0001 to 0 |
|---|---|---|---|
| 3.3 | -3.3 | 1300 | 4 |
Floating-point noise is ignored
EVALUATE
ROW ( "0.1 + 0.2 to 1", ROUNDUP ( 0.1 + 0.2, 1 ) )
| 0.1 + 0.2 to 1 |
|---|
| 0.3 |