Rounding in Python May Surprise You
Published:
The round() function in Python is used to round a float to the specified precision after the decimal point. For the most part this works as you may expect from high school math classes, rounding to the nearest higher or lower number. It’s when rounding two digits that are exactly between the higher or lower number, so for example rounding 2.5 to an integer, things get interesting.
