ngx-mask icon indicating copy to clipboard operation
ngx-mask copied to clipboard

Currency Mask example

Open ufoscout opened this issue 8 years ago • 5 comments

Is it possible to build a currency mask with this library? Something like this: http://next.plnkr.co/edit/zjJw8gfvaVFIUN9OIvea?p=preview&preview

If yes, could you please provide an example?

ufoscout avatar Aug 07 '18 06:08 ufoscout

Try this one: mask="99,999.999.999". You can add so many characters as you need or remove the coins.

unnamed92 avatar Aug 27 '18 15:08 unnamed92

This is what worked for me:

<input type="text" [specialCharacters]="[ '$', ',' ]" mask="$000,000,000,000">

Input: 123456 Output: $123,456

jmac-slash0 avatar Sep 28 '18 20:09 jmac-slash0

@ufoscout You can use prefix like this prefix="$".

pryimakalex avatar Oct 01 '18 15:10 pryimakalex

this doesn't really seem sufficient, using mask="$000,000" with input 1234 yields $123,4

that70schris avatar Feb 05 '19 00:02 that70schris

it works for me <input type="text" mask="separator" thousandSeparator="," prefix="$" >

kidargaw avatar May 07 '20 17:05 kidargaw