Imput (decimal) & State (number)

Hello everybody,

I need your help to solve a problem in my app. :slight_smile:

In my result page, I used a state to calculate a new data to show in a text element. The state is config like this as a number.
Capture d’écran 2020-03-18 à 15.18.20

Now I would like to let the user modify this state to change the result. So I created an input field (Decimal) with the state as initial content. And the user can change the input. When he does that, a workflow is running to calculate the result with the new data.

When I open the page, the number in the input field is like this “1.5”. But when i change it, for exemple to “1.6” calculation are equal to 0. I need to enter “1,6” if I want the calculation to run …

It is not very user-friendly for the user … Do you have an idea to solve this ?

Thanks a lot,
Audric

Hello there,

Do you have an idea what might the problem between . and , ?

Thanks a lot

In some countries decimals are separated by comma (1,6), in others by dot (1.6).
Sometimes the user’s browser gets confused on which to use in an input.

Hello Vini,

I could understand that. But how can you explain that in the same page, a calculation understand a “1.3” and calculations runs correctly, and when you change the input to “1.4”, the calculation fail … and work again if you change to “1,3” ?

Not from the top of my head :thinking:
This is the kind of thing that would be better to see it happening in a page, if it’s possible to isolate that in an example app and share it then please do (:

I observed some weirdness and confusion between “,” and “.” on my end too. Even if I was formatting the decimal with a comma it would still show a dot. What fixed it was to check “show thousand separator” (even though my numbers do not exceed 999) :man_shrugging:t2:

I mean fixed for me, as I want to use commas. Hopefully that can do the trick for you too.

This topic was automatically closed after 70 days. New replies are no longer allowed.