How do I change the decimal separator to a comma on a number input field?

I can't work out how to change the decimal separator to a comma. Any ideas?

In most of Europe we format our numbers like 1.000,00 instead of 1,000.00.
It's a small thing, but is very frustrating because when entering numbers if I key 99,95 then it is entered as 9,995.00

1 Like

Hey @frank, welcome to the community :hugs:

I couldn't get the numbers input to work with european numerical standards.

An easy work-around would be to use a text-input for now and parse it as a Float in your query.

I believe that, ultimately, this should be feature request :))

Sorry I couldn't be of more help.

Thanks for the reply @minijohn, at least it's not just me missing something!

Hmmm, I guess I could do regex validation on a text field and then parse to float as you suggest. But I'd also have to transform my floats coming in to Retool... maybe I'll just tell my colleagues to put up with the pain of finding the "." key :face_with_peeking_eye:

1 Like

has anyone found a workaround for this since the original time of this post?

I have this issue too when working in the Europe area!

Hey @bg1900!

Could you try something like this?

  1. Create a text input component
  2. Add an event handler where the event is Change and action is Run Script
  3. Use this code (replace textInput1 with the name of your text input)
function formatNumber(value) {
  if (!value) return value;
  const newValue = value.replace(/[^\d,.]/g, '');
  const parts = newValue.split(',');
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, '.');
  return parts.join(',');

1 Like