How to make an input mask simulating money with ionic 2?

0

I think the question is quite explanatory, but I would like to know how I can create mask using decimal numbers to simulate the real currency ( 1.000,00 ).

    
asked by anonymous 14.08.2018 / 21:46

2 answers

0

For the number of decimal places, you can use the% s of the angular filter itself:

{{ value_expression | number [ : digitsInfo [ : locale ] ] }}

In your example, you could use:

{{ 1000 | number : '.2' }}

For the number format to be "." for separating thousands, and "," to separate the decimal places, include in html :

import { LOCALE_ID } from '@angular/core';
...
@NgModule({
...
  providers: [
  ...
    { provide: LOCALE_ID, useValue: 'pt-BR' }
  ]
    
14.08.2018 / 22:06
0

The ion-currencymask plugin helped me a lot for this purpose.

    
16.08.2018 / 18:44