R RB Smissaert Well-Known Member Licensed User Longtime User Jan 4, 2009 #1 When I have a SQLite table with a field that is defined as REAL (in the create table SQL) and where all the values in that field are rounded to 2 decimals (update table1 set field1 = round(field1, 2) then when I get that SQLite in a table control (cmd.ExecuteTable etc.) then there will be more than 2 decimals showing in the table control. The only way to get the 2 decimals and no more is to do another round in the cmd.CommandText. Is this a bug or am I missing something here? This is both on the desktop and the device. RBS
When I have a SQLite table with a field that is defined as REAL (in the create table SQL) and where all the values in that field are rounded to 2 decimals (update table1 set field1 = round(field1, 2) then when I get that SQLite in a table control (cmd.ExecuteTable etc.) then there will be more than 2 decimals showing in the table control. The only way to get the 2 decimals and no more is to do another round in the cmd.CommandText. Is this a bug or am I missing something here? This is both on the desktop and the device. RBS
Erel B4X founder Staff member Licensed User Longtime User Jan 4, 2009 #2 The number is stored in the database as a binary number, not a string. It is possible that the binary representation is not completely accurate. So you get trailing zeroes.
The number is stored in the database as a binary number, not a string. It is possible that the binary representation is not completely accurate. So you get trailing zeroes.
R RB Smissaert Well-Known Member Licensed User Longtime User Jan 4, 2009 #3 Yes, that must be it. Other apps though somehow don't show these extra figures. RBS