javascript - Thousands separator with Input mask -


i'm going use this mask ionic 3 app. have setup project this.

.ts

 this.masks = {       budget: ['(', /[1-9]/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],     } 

.html

   <ion-input type="number" [(ngmodel)]="project.budget" [textmask]="{mask:   masks.budget}"></ion-input> 

q: above mask phone number one.can tell me how thousand separated input mask here?

hope can use below reg ex-pattern.but how can apply masks array?

^\d+|\d{1,3}(?:[,.]\d{3})*$ 

budget values numeric.no decimals.e.g. 100,000, 25,000 that.

we can task using createnumbermask addon.

.ts

  const numbermask = createnumbermask({       prefix: '',       thousandsseparatorsymbol: ','     })     this.masks = {       budget: numbermask,     } 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -