diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-21 15:19:42 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-21 15:19:42 -0500 |
commit | f01fa1a5131c287a4efe2708ffe3c9bc57b79468 (patch) | |
tree | 2a2f732edd59c4f42c1eb3e9a9e95ff135091bab /src/py_amount.cc | |
parent | 117dddabd4f883de4f464821f9567d889a6fa449 (diff) | |
parent | acb24d6d22e19d4f6b3883c029dd9fef5c1c9529 (diff) | |
download | ledger-f01fa1a5131c287a4efe2708ffe3c9bc57b79468.tar.gz ledger-f01fa1a5131c287a4efe2708ffe3c9bc57b79468.tar.bz2 ledger-f01fa1a5131c287a4efe2708ffe3c9bc57b79468.zip |
Merge branch 'next'
Diffstat (limited to 'src/py_amount.cc')
-rw-r--r-- | src/py_amount.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/py_amount.cc b/src/py_amount.cc index 09d3294e..8fb507a3 100644 --- a/src/py_amount.cc +++ b/src/py_amount.cc @@ -98,6 +98,10 @@ namespace { return amount.strip_annotations(keep); } + PyObject * py_amount_unicode(amount_t& amount) { + return str_to_py_unicode(amount.to_string()); + } + } // unnamed namespace #define EXC_TRANSLATOR(type) \ @@ -248,8 +252,9 @@ internal precision.")) .def("__int__", &amount_t::to_long) .def("fits_in_long", &amount_t::fits_in_long) - .def("to_string", &amount_t::to_string) .def("__str__", &amount_t::to_string) + .def("to_string", &amount_t::to_string) + .def("__unicode__", py_amount_unicode) .def("to_fullstring", &amount_t::to_fullstring) .def("__repr__", &amount_t::to_fullstring) .def("quantity_string", &amount_t::quantity_string) |