I have a column of type real, when I do a query on that column (using SQLite3 command line interface) the data is shown in scientific notation, not much amusing particularly because the numbers after the exponent are sometimes truncated and not shown (weird!). I've been trying to find a way to change 7.62939453125e-06 to its more friendly representation 0.00000762939453125 (I'd be happy with 7 decimal digits), to no avail. I'm using version 3.8.2, so printf is not an available choice. I even tried round(number*1000000)/1000000, same result.
The best way I have found to prevent scientific notation is to use the printf
function:
sqlite> SELECT abs(1.0/1000000);
1.0e-06
sqlite> SELECT printf('%f', abs(1.0/1000000));
0.000001
Here's a link to the official docs: https://www.sqlite.org/lang_corefunc.html#printf
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With