-1

I am trying to create a directive or pipe that allows me to show formatted an input text as 12.345,67 and too when input numbers with decimal point with enter the decimal comma with comma (,) so 12345,67 not as a period.

Obviously, putting the comma as a decimal gives an error.

Try directive https://stackblitz.com/edit/angular-cf2hz8

Try custom pipe https://stackblitz.com/edit/angular-p3jc14

Theasker
  • 1
  • 3

1 Answers1

0

Finaly I find the solution:

I used "Control Value Accessor" of Angular to create my own component use it in this way:

<app-control-value-accessor
     [(value)]="numero"
      required 
      >

https://stackblitz.com/edit/angular-tay52r

Theasker
  • 1
  • 3