1

I use curreny pipe, but it add digits after dot. How to remove them?
The result of {{ 1111111 | | currency:'ILS' }} is 1,111,111.00. I want to remove the ".00"

I tried to use both pipes, curreny and number: {{ 1111111 | number: '2.0' | currency:'ILS' }} but it don't give any result.

jowey
  • 7,581
  • 6
  • 27
  • 46
user3590450
  • 463
  • 1
  • 6
  • 13
  • What is your desired output ? – Bozhinovski Jul 08 '20 at 07:55
  • 1,111,111. {{ 1111111 | currency:'ILS' }} result is 1,111,111.00 – user3590450 Jul 08 '20 at 07:56
  • You are getting this error: InvalidPipeArgument: '1,111,111 is not a number' for pipe 'CurrencyPipe'. Maybe use only the currency pipe and have a look at setting locale for numbers: https://stackoverflow.com/questions/37684360/how-to-set-locale-for-numbers-in-angular-2-0/43099150 – anexo Jul 08 '20 at 07:59

1 Answers1

2

Try this

{{ 1111111 | currency:'ILS': 'symbol':'1.0-0' }}

symbol will remove zero's.

Please read the documentation is really explained in details. https://angular.io/api/common/CurrencyPipe

Happy coding

Bozhinovski
  • 2,496
  • 3
  • 20
  • 38