0

Am looking for the solution while enter input value 1 its become $0.01 if input value 123 its become $1.23. maybe its duplicate question but I tried many solutions but not get working in Angular 5 please help

similar like the angularjs 1.5

Deepak
  • 571
  • 7
  • 19
  • You want to use a 'currency pipe' as described in this answer to a similar question: https://stackoverflow.com/a/48670949/5580153 – Aaron Lavers Jan 29 '19 at 05:46
  • with currencyPipe able to convert decimal but its returning if enter 1 value $1.00 – Deepak Jan 29 '19 at 05:57

2 Answers2

1

you can use ngx-mask library for it. it is available for Angular 5. This is github repository https://github.com/JsDaddy/ngx-mask. you can check it out

Anuj Gupta
  • 65
  • 1
  • 8
1

We can perform arithmetic calculation in interpolation. So here you use combination of arithmetic expression and currency pipe.

For example : {{input / 100 | currency}}.

Ankit Prajapati
  • 2,670
  • 2
  • 12
  • 22