Using angular 4,
{{31.94 | number:'1.0-0'}}
Output: 32
Any idea, how to block the round off. Expecting the result is 31
Using angular 4,
{{31.94 | number:'1.0-0'}}
Output: 32
Any idea, how to block the round off. Expecting the result is 31
You need to create your custom pipe as DecimalPipe doesn't provide any floor feature. Plus you can add your decimal pipe in it. Your Custom Pipe:
Use in template as:
You might not need an extra custom pipe. Output is a string and there are plenty of string pipes. You might truncate like this :
Would achieve your desired output in that specific case.
You'll still want to use custom pipe for now if you don't want padding 0.
your.component.ts
your.module.ts
your.component.html