Forum Academy Marketplace Showcase Pricing Features

Save Decimal Number in Database

I’m trying to save a number into the database but not from an input field.
When I save from an input I have a choice if this is an integer or decimal however if I save the number 6.5 when creating a new thing bubble turn this number into 7

How can I tell the app that it should be saved as decimal when saving a number at the creation of a new thing?

1 Like

It’s not actually being turned into 7. It does that on my apps as well. If you click the “pencil” to look at the values, you’ll see that it was saved correctly.

Pretty sure it just rounds up for the sake of the display.

1 Like

I use these values to calculate more values, I wonder if it’s being used as an integer when I further use in future calculations or being used as decimal.
I’m gonna do some debug_mode and hope for the best.

They shouldn’t be used as integers in calculations. I have an app that rounds up the spare change from people’s bank account transactions, so virtually all of my numbers are decimals. The calculations run fine.

If it turns out any different for you, it may be a bug.

1 Like

Hi guys. So is there any fix planned to display the right decimal data in the database?
If you set “text” as the type in the database, you’ll see 6.5 instead of 7. But then you can’t perform any arithmetic operations in the further use on it. So I was wondering if there is maybe a way to cast the “text” to “Decimal”, it might be another solution to achieve this?
Thanks

have you found any solutions. I am struggling with my longitude & latitude values.

It would be nice if the values didn’t round on the display and time elements showed the hour, minute, second, etc.

That said, once you know if works this way (and the underlying data does, in fact, still retain the decimals and hours, minutes, and seconds), it’s easy enough to download the data and review it. A bit tedious, especially when you have to do it frequently, but workable.

By the way I had the same problem and found the answer.

You have to change the input type to “decimal” instead of “integer”.

That did it for me.