Rounding up to the next 100

Michael.Coll-Barth at VerizonWireless.com Michael.Coll-Barth at VerizonWireless.com
Thu Jan 21 23:03:50 CET 2010


 

> From: Arnaud Delobelle
> 
> 
> > >>> XstrNmbr = 3579.127893
> 
> I meant
> >>> XstrNmbr = "3579.127893"
> 
> > >>> round(float(XstrNmbr), -2)
> > 3600.0

Ah, then you will need to cast it first.

>>> XstrNmbr = '3579.127893'
>>> round(float(XstrNmbr) ,-2)
3600.0



The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure.  If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof.  Thank you.





More information about the Python-list mailing list