r20128 - gnucash/trunk/src/optional/python-bindings - Bug #639906: Adding __str__ and __unicode__ methods to GncNumeric

Christian Stimming cstim at code.gnucash.org
Thu Jan 20 15:14:41 EST 2011


Author: cstim
Date: 2011-01-20 15:14:40 -0500 (Thu, 20 Jan 2011)
New Revision: 20128
Trac: http://svn.gnucash.org/trac/changeset/20128

Modified:
   gnucash/trunk/src/optional/python-bindings/gnucash_core.py
Log:
Bug #639906: Adding __str__ and __unicode__ methods to GncNumeric

Patch by Christoph Holtermann:

1) I decided to let the methods return "Division by Zero" for denom()==0.
2) As proposed in
http://stackoverflow.com/questions/1307014/python-str-versus-unicode i created
both __str__ and __unicode__.
3) I use format to fix the decimal places to 2. It would be nice if the number
would be configurable.



More information about the gnucash-patches mailing list