How do I round numbers to a specific value in python programming?eg:1154 to nearest 20 or 50 or 200 or 500?
I am using Python 2.5 and usually want to round UP, so directional rounding is important too.
ThanksHow do I round numbers to a specific value in python programming?eg:1154 to nearest 20 or 50 or 200 or 500? Find the modulus of a number and then subtract or add. e.g in Python:
No comments:
Post a Comment