Required to store in a SQLite database the long decimal numbers. 12 signs - integer part, and 8 - in decimal, like that - '123456789012,12345678' (positive numbers only)
drop table if exists table1;
CREATE TABLE table1 (
a INTEGER,
b DECIMAL(20,8)
);
INSERT INTO table1 select 1, 123456789012.12345678;
select * from table1;
Query result:
RecNo a b
----- - ---------------------
1 1 123456789012.12345900
As we can see, it is rounding off the last digits in the decimal part. How can I get accurate result without rounding?
SQLite stores numeric (decimal) data types up to 8 bytes. But that is not sufficient to store your number including decimal places.
You could use blob to store it or text.
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