Search code examples
angularangular-pipe

How to use Angular CurrencyPipe to display money in thousands


I have some salary information that I want to display in the format: $55k

Using the CurrencyPipe I display:

{{salary | currency:'USD'}}

This will show as

$55,000.00

Can you use the CurrencyPipe to display in 'k', with 1 decimal point if necessary.

Eg. $55340 will display as $55.3k


Solution

  • I just came across how to do this. You use digitInfo like so:

    {{(salary/1000) | currency:'USD': 'symbol':'1.0-1'}}k