wcmadness <[EMAIL PROTECTED]> wrote:
I'm writing a financial application and MUST have exact math decimals
(no floats). So, I'm using Python's decimal module.

My database is Sqlite (and my language is Python with Pysqlite);
Sqlite doesn't offer a non-floating point decimal type. But, it does
have adapters and converters to store data as a native Sqlite type
(string / text) in the database

Personally, I prefer storing monetary values in the database as scaled integers. Say, store all values in 1 millionth of a dollar units, so one dollar is 1000000, and one cent is 10000. Most math works on this representation out of the box.

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to