How does "ROUND_HALF_EVEN" works in python and please give some examples? Thanks.
ROUND_HALF_EVEN is the strategy used by Python's built-in function round(). It works in a way such that the last digit of a result of rounding will always be even. Example: When 4.5 is rounded, it should give 5 but round(4.5) will result in 4 since 4 is the nearest even digit. Also round(5.5) will result in 6 as intended, since 6 is the nearest even digit. Another good example is round(0.25,1) which rounds 0.25 up to 1 decimal place and should yield 0.3, but results in 0.2 since 2 is the nearest even digit.
How does "ROUND_HALF_EVEN" works in python and please give some examples? Thanks.