1 year ago

#192824

test-img

GreekSwiss

Angular 13 / ngx-mask thousand seperator mask

Hello i am using the following ngx mask template:

      <input
        class="form-control"
        type="text"
        mask="separator.2"
        thousandSeparator="'"
        separatorLimit="1000000000"
        [dropSpecialCharacters]="[',']"
      />

I want the user to be able to use a "." for cents/pennies payments. For example 1000.00 but not be able to use a "," like 1000,00.

For this i am trying to use the dropSpecialCharacters and drop the "," but this doesnt work, any ideas ?

An extra thing i would like to implement then is something like the number pipe in angular. When the user types 1000 it should automatically become to 1000.00 if the user types 1000.40 then it should stay like this.

So to summary, user types in: 1000000 this should become 1'000'000.00 if the user types in 1000000.40 this should become 1'000'000.40 but in no way a "," should be used.

Thank you

angular

mask

ngx-mask

0 Answers

Your Answer

Accepted video resources