[SOLVED] Input currency mask - IONIC


I need a help to input currency mask to Ionic 3.
Example, I’ll input type and digits in real number 0.00.

Thanks… :slight_smile:

Hi, @medeiraf

You can use angular2-text-mask in ionic 3



1 Like

Hi, @addwebsolution
Thanks for answer.
It’s work, but how to apply currency mask?

Hi. I dealed with the Angular currency pipe and finally ended making my own input component and using the number pipe like:

| number:'4.2-2'

I had many problems getting the right values.

To use it on a ion-input perhaps your best option is to make your own pipe to format the currency values, something like:

      [ngModel]="currencyValue | currencyFormat:applyFormat"
      (ionBlur)="applyFormat = true;"
      (ionFocus)="applyFormat = false;"></ion-input>

Here you’re using single binding so you can apply any custom pipes to format your values.
Take a look at https://stackoverflow.com/questions/34990102/angular2-data-binding-for-custom-reusable-component for the updateData() function.
Also try:

Hope it helps. Best regards.


Whoa! :smile:
it’s work! Thaanks… :+1:


Unfortunately, we are unable to support Ionic 2 ion-input at this point as it overrides the ControlValueAccessor that Text Mask requires to perform its job.

did u get it ?

1 Like

Yes, its understood.