Angular: How to format number without any decimals using 'number' pipe
In Angular, you can use the number pipe to format a number without decimals by specifying '1.0-0'
as the format. Here is how you can do it:
<div class="value">{{myvalue | number:'1.0-0'}}</div>
In order for this to work, you need to import
CommonModule
:
imports: [
CommonModule
],