Decimal Pipe in Angular 2 - Commas Only, No Decimal Places

前端 未结 1 1891
攒了一身酷
攒了一身酷 2020-12-31 02:32

I currently use this pipe {{ product.productPrice | number:\'.2-2\' }}

And result is 1,000,000.00 but I want to remove the .00 How do you d

相关标签:
1条回答
  • 2020-12-31 03:04

    Use this :

      {{product.productPrice | number: '1.0-0'}}
    

    1.0-0 means: at least one digit before decimal point, 0 digits after decimal point.

    https://angular.io/api/common/DecimalPipe

    0 讨论(0)
提交回复
热议问题