round down to nearest number

Ian Kelly ian.g.kelly at gmail.com
Fri Feb 10 01:47:09 CET 2012


On Thu, Feb 9, 2012 at 5:30 PM, noydb <jenn.duerr at gmail.com> wrote:
> How do you round down ALWAYS to nearest 100?  Like, if I have number
> 3268, I want that rounded down to 3200.  I'm doing my rounding like
>>>> round(3268, -2)
> But, how to round DOWN?

>>> 3268 // 100 * 100
3200

For more complicated cases, Decimal objects allow you to specify
alternate rounding modes.



More information about the Python-list mailing list