]> granicus.if.org Git - python/commitdiff
Issue #10813: Small improvement to decimal money format recipe.
authorRaymond Hettinger <python@rcn.com>
Sat, 8 Jan 2011 09:03:11 +0000 (09:03 +0000)
committerRaymond Hettinger <python@rcn.com>
Sat, 8 Jan 2011 09:03:11 +0000 (09:03 +0000)
Doc/library/decimal.rst

index 7c448e6ceb559bb0e6855437b8087957ec17e229..bf153ba30f5b18f438abdc98c65ad676af3b016a 100644 (file)
@@ -1657,7 +1657,8 @@ to work with the :class:`Decimal` class::
            build(trailneg)
        for i in range(places):
            build(next() if digits else '0')
-       build(dp)
+       if places:
+           build(dp)
        if not digits:
            build('0')
        i = 0