[Python-checkins] python/dist/src/Doc/lib libdecimal.tex,1.21,1.22

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Wed Nov 24 06:53:29 CET 2004


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18609

Modified Files:
	libdecimal.tex 
Log Message:
SF bug #1071566:  moneyfmt recipe in decimal documentation has error



Index: libdecimal.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdecimal.tex,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- libdecimal.tex	20 Nov 2004 00:33:51 -0000	1.21
+++ libdecimal.tex	24 Nov 2004 05:53:26 -0000	1.22
@@ -993,6 +993,8 @@
     '1.234.568-'
     >>> moneyfmt(d, curr='$', neg='(', trailneg=')')
     '($1,234,567.89)'
+    >>> moneyfmt(Decimal(123456))
+    '123,456.00'
     
     """
     q = Decimal((0, (1,), -places))    # 2 places --> '0.01'
@@ -1009,7 +1011,7 @@
     while digits:
         build(next())
         i += 1
-        if i == 3:
+        if i == 3 and digits:
             i = 0
             build(sep)
     build(curr)



More information about the Python-checkins mailing list