budget:number=50000;
{{budget | currency:'USD':true}}
The above code displays the budget like this
$50,000.00
But I want it to display like this
$50,000
From the Currency Pipe docs the third option uses the same format as the Decimal Pipe :digitInfo
So you can use:
{{budget | currency:'USD':'symbol':'1.0'}}
Plunker example
Edit: Jota.Toledo pointed out that you could display the cents if they're available with
{{budget | currency:'USD':true:"1.0-2"}}
Edit: Thanks to Abhay Naik for drawing attention to the v5 deprecated parameters.
{{budget| currency : 'USD' : 'symbol' : '1.0-0' }}
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