[BangPypers] HELP ON FORMATING OUTPUT

Nanolets nanolets srini at nanolets.in
Sat Mar 22 07:10:25 CET 2008


A stupid way to do this is

x=123456789
x=str(x)
n=len(x)
s=n%3
outs=x[0:s]
while ( s < n) :
       outs = outs + "," + x[s:s+3]
       s=s+3
print outs

On 3/19/08, Jiten Shah <jiten_shah_78 at yahoo.com> wrote:
>
> Dear Friends,
>
> I am new for python and new for this mailing list also
>
> My problem is i want to print
>    1156179 to ->   1,156,179.00
>
> Can somebody help me.
>
>
> Jiten
>
>
>
>
>
>
>       ____________________________________________________________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile.  Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/bangpypers/attachments/20080322/708ef42c/attachment.htm 


More information about the BangPypers mailing list