monetary applications [was: Python GUI app to impress the bos s?]

Gerhard Häring gerhard.haering at opus-gmbh.net
Thu Sep 19 04:36:02 EDT 2002


Paul Boddie wrote:
> Taking a look at pyPgSQL, as the only database module I have installed
> that actually readily documents such things (and that should tell you
> something), it would seem that monetary amounts are converted to floating
> point numbers - surely the first thing one would want to avoid in
> manipulating financial data.

Yeah, we should probably change PgMoney to use PgNumeric, which is a
fixed-point type that uses Python's long internally. I've added it to the
TODO list [1].

Btw. the MONEY type is deprecated in favour of NUMERIC and DECIMAL under
PostgreSQL [2]

-- Gerhard

[1] http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pypgsql/pypgsql/TODO?rev=1.2&content-type=text/vnd.viewcvs-markup

[2] http://www.postgresql.org/idocs/index.php?datatype-money.html



More information about the Python-list mailing list