# Math column glitch?

Hi, I have this app where I do my budget using math columns for the most part. But I am having two problems. One is with a -0,00 result when some math is done involving decimal values. I’ve checked the value with more than 2 decimals and it’s still -0,0000. Another problem has to do with a condition for a component’s visibility. The component should show if the budget is 0, but after performing the math (76,03+70-146-0,03) and with the budget at 0,00 the component doesn’t show.

Your help will be much appreciate it. Thanks!

Just a guess to try… Can you try it using decimals instead of commas in your formulas? I’ve never used a different currency, but it could be possible that a Glide Math column only accepts decimals.

Hi, thanks. I don’t think I have the option to change that. I put down the decimals separated with dots but Glide changes it to commas, probably because of my location

Can you show your math formula? I’m guessing that it has some decimals beyond 2 decimal places, so the end calculation is negative or positive (ex. -0.00001 or 0.00001) which rounds as -0.00 or 0.00 based on the precision you have set. This may be affecting your condition as well, as it’s most likely looking at the underlying calculated value instead of the value shown with the precision set.

I always think of the precision and unit settings on numeric columns (as well as date formatting settings on date columns) as filters that determine how to display the value to the user. Those settings don’t ultimately affect what the final underlying value is. The underlying value is kept so you can still use the value for other calculations. Just like if you were to put a random word as the Unit value, instead of the Euro symbol, You can still work with that number as a number, otherwise any other math on that column wouldn’t work because there would be this random word breaking the math.

In your case, I would take your calculated value, multiply it by 100, round it, then divide by 100. Like this:

`ROUND((76,03+70-146-0,03)*100)/100`

That should give you a true rounded zero value if the result should be zero.

2 Likes

Thanks so much for your answer. I fixed it! Your formula was super useful in google sheets but it didn’t work the same way in Glide.

But you got me digging and this was not a Glide error, same was happening in google sheets. As you suspected the value was negative with more decimals.

All I did was change the place of one value. So instead of 76,03+70-146-0,03 I did 76,03-0,03+70-146 and it gives me a perfect zero. I still don’t understand it but I did that both in google sheets and glide and it fixed it.

Again, thank you so much!

1 Like

Hmmm, the formula was indented to be used in a math column in glide, but glad you got it working.

1 Like