Angular 2 CurrencyPipe space between currency and number?

后端 未结 10 1086
轻奢々
轻奢々 2021-02-18 21:08

I noticed that there is a pipe called CurrencyPipe in Angular 2, which will filter some decimals from a number. This also adds the ISO currency indicator, ie \'USD\' or any othe

10条回答
  •  误落风尘
    2021-02-18 21:56

    Do you really need to use currency pipe? You can always separate the currency from the amount :

    {{ product.currency }} {{ product.price|number:'1.2-2'}}

    or in your case :

    USD {{ product.price|number:'1.2-2'}}

提交回复
热议问题