Formatting numbers
Daniel Klein
DanielK at jBASE.com
Tue May 1 19:41:31 EDT 2001
Ok, this is what I've come up with so far
x = 12345
print '%.2f' % (x,)
Is there a 'less painful' way to specify dollars and cents when the
information is stored as an integer with an implied 2-decimal places?
Thanks for your patience and understanding,
Dan
"Daniel Klein" <DanielK at jBASE.com> wrote in message
news:vqHH6.19$7O2.802 at typhoon.aracnet.com...
> This is almost embarrasing to have to ask this but I can't seem to find
this
> information.
>
> Given an integer, 12345, how to format this to 123.45 ?
>
> Thanks,
> Dan Klein
>
>
>
>
More information about the Python-list
mailing list