SQLite Forum

Division by decimals wrongly returning a rounded int result (works fine when casting to real)
Login
> And as you can see on my schema, they are indeed decimals and not integers.

See <https://www.sqlite.org/datatype3.html#affinity_name_examples>.  SQLite
stores integers in a DECIMAL column when it can.  To force floating-point
values, you want to use REAL.

Also be mindful of the [limitations of floating point numbers][2].  Depending
on your requirements, you might want to store values as in integer number
of cents, then convert to dollars (or whatever currency you are using) in
the application code.

[2]: https://www.sqlite.org/floatingpoint.html