diff options
author | Raymond Hettinger <python@rcn.com> | 2008-04-17 10:48:31 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-04-17 10:48:31 (GMT) |
commit | 5eaffc4ce1279cd023df68a6ee1fd1a5919bff2b (patch) | |
tree | fdb8535d3b3bf1cce46ddb07306562ca54f7ef48 /Doc/library/decimal.rst | |
parent | 967a83c4efdbd32f24763bc90afabcfe3d76f4b6 (diff) | |
download | cpython-5eaffc4ce1279cd023df68a6ee1fd1a5919bff2b.zip cpython-5eaffc4ce1279cd023df68a6ee1fd1a5919bff2b.tar.gz cpython-5eaffc4ce1279cd023df68a6ee1fd1a5919bff2b.tar.bz2 |
Issue 2648: Add leading zero to money format recipe in the docs.
Diffstat (limited to 'Doc/library/decimal.rst')
-rw-r--r-- | Doc/library/decimal.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst index a79272f..a792f41 100644 --- a/Doc/library/decimal.rst +++ b/Doc/library/decimal.rst @@ -1426,7 +1426,7 @@ to work with the :class:`Decimal` class:: >>> moneyfmt(Decimal(123456789), sep=' ') '123 456 789.00' >>> moneyfmt(Decimal('-0.02'), neg='<', trailneg='>') - '<.02>' + '<0.02>' """ q = Decimal(10) ** -places # 2 places --> '0.01' @@ -1439,6 +1439,8 @@ to work with the :class:`Decimal` class:: for i in range(places): build(next() if digits else '0') build(dp) + if not digits: + build('0') i = 0 while digits: build(next()) |