If you store money as an integer with an "implied decimal point" (a familiar method for old-time COBOL programmers) it will work. We have added a DECIMAL type to Sqlite. This stores fixed point numbers in ASCII display format and performs accurate artithmetic and presents nicely from HTML.

Floating point numbers for money is a perennial trap for young players.

Mikey C wrote:
Hi there,

Currently I am using a SQLite 3.x database that stores and calculates
currency values using the column type NUMERIC (which I believe has a FLOAT

However this leads to errors in storing values values in floating point

I guess there is no planned support for direct fixed point types, so what is
the best approach?

Store the monetary values in an INTEGER column and multiply all values up by
100 to store in pence/cents?

Any advice?



To unsubscribe, send email to [EMAIL PROTECTED]

Reply via email to