I wrote on Linux PC python3 in eric the following code:
import sqlite3
conn = sqlite3.connect("dbug26.db")
c=conn.cursor()
c.execute("CREATE TABLE IF NOT EXISTS prices (price1 REAL,price2 REAL,
price3 REAL, price4 REAL, price5 REAL)")
c.execute("INSERT INTO prices VALUES (0.01, 0.01, 2.60, 0.01, 2.60)")
conn.commit()
c.execute("SELECT * FROM price")
prices = c.fetchall()
print (prices)
c.close()
conn.close()
If I run the code in python3 in Linux then the output is:
>>> [(2.6,), (1.0,), (2.6,), (1.01,)]
but if I run exactly the same code in qpython3 on Android then the output is:
>>> [(2.6000000000000001,), (1.0, ), ((2.6000000000000001,), (1.01, )]
Where do the extra decimal zeros and one in qpython3 come from? What can I do to prevent this ?
If I look at the sqlite db in several db-browsers on Linux,Mac and Android the data always appears correctly.