[pyar] [Programación]Formatting numbers

Diva Satanica apokalyptica79 en gmail.com
Mar Mar 13 10:17:13 ART 2012


Se acuerdan del ejemplo que dí:

#This program demonstrates how a floating-point number can be displayed as
currency.
monthly_pay = 5000.0
annual_pay = monthly_pay * 12
print ('Your annual pay is $', \
         format(annual_pay, ',.2f'), \
         sep='')

Bueno lo hice de otra manera:

#This program demonstrates how a floating-point number can be displayed as
currency.
monthly_pay = 5000.0
annual_pay = monthly_pay * 12
print ('Your annual pay: ')
print (format(annual_pay, ',.2f'))

Más que seguro que no está bien pero lo hice así y funcionó.

Quedó así:

Your annual pay:
60,000.00

Saludos

PS: Espero puteadas [?][?]
-- 


Divine queen of evil
Sowing her seeds of hate
Mistress of pain
Diva satanica - Master of temptation
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20120313/87c0f800/attachment.html>
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: 331.gif
Type: image/gif
Size: 362 bytes
Desc: no disponible
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20120313/87c0f800/attachment.gif>
------------ próxima parte ------------
A non-text attachment was scrubbed...
Name: 32F.gif
Type: image/gif
Size: 104 bytes
Desc: no disponible
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20120313/87c0f800/attachment-0001.gif>


More information about the pyar mailing list