How to round up or down a number using DecimalPipe
in Angular
I think, DecimalPipe
will round a number by default, like:
Rounding({{value | number:'1.0-2'}})
1.234 => 1.23
1.235 => 1.24
In my case, I'd like to round up/down a number, like:
Rounding up({{value | number:'1.0-2'}})
1.234 => 1.24
1.235 => 1.24
Rounding down({{value | number:'1.0-2'}})
1.234 => 1.23
1.235 => 1.23
How can I achieve this directly using DecimalPipe
?