Input that adds a comma separator when entering a number

Hi everyone,

I am trying to use an input that adds a comma separator when entering a number(10,000)
I know that there is an amount field input, which adds the comma when the mouse leaves the amount input, but I need the comma to be displayed in real time when the user is typing the number.

I would like to know if anyone knows a solution for this.

Thanks in advance!

You could try using our new masked input

I was trying it but I couldn’t put the correct pattern for amounts

1 Like

I’d try using the AI copilot that is present in WeWeb

Have you found a solution? I was not able to find the right pattern for the mask input

Broberto is in every thread I am interested in as it seems =) Hi,

I tried the same thing but could not find a solution as all docs and also the ai is telling us to use javascript to change the mask and not only a pattern. It seems as it is not possible without, right?

var numberMask = IMask(
  document.getElementById('number-mask'),
  {
    mask: Number,
    scale: 0,
    thousandsSeparator: '.'
  });

I have the mask input in a repeater…

image

The Docs for easy patterns are clear but the thousands separator works from right to left so I don’t how to do that just with a pattern…

Hi @luka if I put a pattern (000,000,000) in masked input pattern it is separating the input but it is doing it from left to right (for ex: 123,45) how do I make it (12,345)?

For whose still looking a solution, i have one at this comment Thousands separator comma number input - #2 by Duke_N