6
kivisi
5y

Why does the sqlite SUM function round down values?? WHY?

10333.03 is printed as 10333

This has caused me so many problems?

What is the solution to this?

Comments
  • 5
    Never mind. My bad.

    I was getting the value from the column as string instead of float. Apparently when you do this, it gets rounded down.

    i just wasted 4hrs on this.
  • 4
    So the actual problem was SQLite's "flexibility" when it comes to column types. I never understood why they did it.
Add Comment