round down to nearest number
ckaynor at zindagigames.com
Fri Feb 10 02:41:51 CET 2012
On Thu, Feb 9, 2012 at 5:40 PM, Chris Kaynor <ckaynor at zindagigames.com>wrote:
> On Thu, Feb 9, 2012 at 5:23 PM, noydb <jenn.duerr at gmail.com> wrote:
>> hmmm, okay.
>> So how would you round UP always? Say the number is 3219, so you want
>> 3300 returned.
> You may want to look into the mathematical floor and ceiling functions.
> Python exposes them in the math module as floor and ceil.
>  http://en.wikipedia.org/wiki/Floor_and_ceiling_functions
>  http://docs.python.org/library/math.html#math.floor and
I should have added, you can use multiplication and division to apply those
functions to other digits rather than the base one. For example, multiply
by 10, floor, divide by ten, will floor to one decimal point.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list