I am trying to round my values to 2 decimal places in python (using jupyter notebook) and then insert those values into SQLITE3 but some of the values are not rounding:
Request:
count = cursor.execute("""SELECT test_user,
SUM(CASE WHEN start >= ? THEN round(julianday(end)*24, 1) - round(julianday(start)*24, 1) ELSE 0 END),
FROM test_table
WHERE start < ?
GROUP BY test_user""", (sdate.to_pydatetime(), edate.to_pydatetime())).fetchall()
Response:
[('1', 0, 8.0, 8.0),
('2', None, None, None),
('3', 0, 7.0, 7.0),
('5', 0.20000000298023224, 0.20000000298023224, 0.20000000298023224),
('6', 0.19999999552965164, 10.199999995529652, 10.199999995529652),
('7', 0.0, 0.0, 0.0),
('8', 5.100000001490116, 5.100000001490116, 5.100000001490116)]
As you can see some of the values have rounded but others have not. Is there another way to round the values?