I am developing a trading system which stores data in SQLite, consisting of OHLC and volume. I would also like to store some indicators like RSI etc I read the other answer which indicated integers as the data type. In my case I am looking at 8 digit precision which would slow down the calculations if I were to multiply every value by 1e8 Any recommendations are appreciated!

1 Answer 1


The FAQ pretty much explains the reason why you don't want to use their REAL data type for storing numbers with 8 decimal places.

(16) Why does ROUND(9.95,1) return 9.9 instead of 10.0? Shouldn't 9.95 round up?


Workaround 1

The trick of using an INTEGER to achieve your required level of precision has been used since computers existed.

With today's powerful CPUs, I wouldn't worry about the overhead of any additional calculations. You'll need to run benchmarks to (dis)prove my statement.

Workaround 2

IMHO - You shouldn't use a tool that doesn't support your requirements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.