I am using the decimal pipe to limit decimal number to two places:
{{amount | number:'1.2-2'}}
But unfortunately the above pipe rounds off the number. Is there any way I can limit the output to two places after decimal without rounding off the number.
I'd suggest that you write a custom pipe to do this.
The documentation is found here:
Updated docs https://angular.dev/guide/pipes/transform-data
Here is a good example how to use a pipe for formating numbers
Angular 2 - Number pipe for scientific notation numbers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With