Search code examples
pythoncurrencyrounding-errorarbitrary-precisionprecision

What class to use for money representation?


What class should I use for representation of money to avoid most rounding errors?

Should I use Decimal, or a simple built-in number?

Is there any existing Money class with support for currency conversion that I could use?

Any pitfalls that I should avoid?


Solution

  • http://code.google.com/p/python-money/ "Primitives for working with money and currencies in Python" - the title is self explanatory :)