On Jan 21, 1:58 pm, noydb <jenn.du...@gmail.com> wrote:
> Sorry, although what I really need is the string-number rounded UP
> every time.  So if the number is 3890.32, it needs to go to 3900; if
> the number is 3811.345, it needs to go to 3900 also.
>
> So, Florian's answer works.

Another option is using math.ceil and math.floor.

>>> import math
>>> 100*math.ceil(1234.5678/100)
1300
>>> 100*math.floor(1234.5678/100)
1200
>>> 100*math.ceil(-1234.5678/100)
-1200
>>> 100*math.floor(-1234.5678/100)
-1300

casevh
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to