How to make a Mask input by simulating money with Ionic 2?

Asked

Viewed 499 times

1

I believe the question is already well explained, but I would like to know how I can create a mask using decimal numbers to simulate the actual mints ( 1.000,00).

2 answers

0

0

For the number of decimals, you can use the html the very filter of angular:

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

In your example, you could use:

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

For the number format to be "." for separating thousands and "," for separating decimals, include in app.module.ts:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.