Format number with comma

Hi everyone,

I have an issue with the format number in my database. When I add a number like 9,75, it appears 9 in the database.

It’s working with 9.95

Do you know if there is any solution to get the 9,97 format with a comma ?

Many thanks,

That’s complicated in case the issue involves inputs. There are some solutions out there in the forum. However when I faced something similar, a user had his keyboard only type dots when I needed commas, I made a plugin called “Instant value replacer”, I then shared it for free, you can see it here in case it’s helpful for you:

Changes the character the user typed to something else at the exact moment the user types it (on the fly).
For example the user types “a” and what appears is “b”. One use case is swapping dots with commas or the other way around in number inputs.

If it’s not an input, you can use “find and replace” in the value, swap dot for comma then convert back to a number.

Bubble DB datatypes accept only US-style decimal types (AKA, the period) for numerical entries. You’ve got 2 options: alter the datatype of the field from number to text, which allows users to slam in anything, but this can be dangerous for your calculations down the road and may require REGEX to reinterpret correctly.

The second option is to convert the value prior to DB entry to the standard decimal format, either by using REGEX to replace the commas with periods or the above-mentioned plugin. Then, on redisplay to the users if you need to show the decimals as commas, simply display the number :FORMATTED AS NUMBER (where you can specify the decimal to be a comma for display again)

The same thinking goes for dates as well: always convert dates and store in standard formats, then re-convert for display again when retrieving for user viewing.

Thank you very much @vini_brito and @anon38627393 :+1:

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