Money data type

Mark Wilson mwilson13 at cox.net
Thu Sep 18 09:13:22 CEST 2003


One should be very wary of using floating point arithmetic when dealing 
with money. For a discussion of the limitations of floating point 
arithmetic, see:

http://www.python.org/doc/current/tut/node14.html

For financial applications, fixed point arithmetic with an appropriate 
(currency-dependent) scaling factor is usually most appropriate. For 
division operations, the modulo operator can be used to determine 
fractional currency units.

Regards,

Mark






More information about the Python-list mailing list