Search code examples
angularangular5decimaldirectivemasking

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


Solution

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

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