Simple Addition Calculation Incorrect

Anyone else experiencing some odd issues with calculations where the result should be a simple number to 2 decimal places, but Bubble calculates it to a number that extremely close, but a small decimal amount off (such as 0.0000000006 off)?

Here is my example, the calculation is simple addition:

Screenshot_121919_115319_AM

Yet here is the Bubble result:

Screenshot_121919_115401_AM

Can you show the amount setting? (Or the amount in DB)

The Amount field is rounded to 2 decimal places before saving, and the records in the DB are correct to 2 decimal places (this one 1 decimal place)
Screenshot_121919_013428_PM

I suggest you to look the field using the debug_mode=true. Check the list of debit’s amount (click on it just before :sum)
You will see exactly what is coming from the DB. If the amount are correct, I think this is a bug and you should submit a ticket to Bubble.

Here are a few links to explain what I’m pretty sure is happening due to the code behind-the-scenes.

I’d probably add the :rounded to function to see if you can use that to get around this. Let me know if that doesn’t work!


Kevin
AirDev

We’re looking for Bubble developers to join our team: https://jobs.airdev.co/

2 Likes

This is definitely it and explains some other cases when I have come across this.

It is a frustrating result for a non technical person though that decimal points are not the exact number that is equated, maybe @bubble can work some magic in the background to help fix this for the average user who would not expect it

Example from the link above shown in Bubble:

1 Like

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