On 7 Aug 2006 07:55:11 -0700, abcd <[EMAIL PROTECTED]> wrote:
> if i have a number, say the size of a file, is there an easy way to
> output it so that it includes commas?
>
> for example:
>
> 1890284
>
> would be:
>
> 1,890,284
>

I was bored !!

>>> a = 1890284
>>> ','.join([str(a)[::-1][x:x+3] for x in range(len(str(a)))[::3]])[::-1]
'1,890,284'

Ugly !

:)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to