Deepak
Deepak

Reputation: 591

Angular 5 decimal mask while enter input

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

Upvotes: 0

Views: 4617

Answers (2)

Ankit Prajapati
Ankit Prajapati

Reputation: 2820

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

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

Upvotes: 1

Anuj Gupta
Anuj Gupta

Reputation: 65

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

Upvotes: 1

Related Questions