SQLite Forum

storing number with 2 decimal place
Login
If '2.00' is not identical to '2.0' and '2' then you're not handling numbers, you're handling strings.  You have two easy options, both of which are computationally sound .

1) Do all your handling of whatever '2.00' is using string variables. That means declaring string variables in whatever programming language you're using, declaring a <code>TEXT</code> column in the SQLite database, etc..

2) Do all your handling of whatever '2.00' using integers, with the number multiplied by 100. That means declaring integer variables in whatever programming language you're using, declaring an <code>INTEGER</code> column in the SQLite database, and doing programming to print the number divided by 100 to two places when you want to print it.  This is the normal way computers handle amounts of money with a one-hundredth base.