# round() uses banker's rounding and float error: round(2.5)==2, round(0.125,2)==0.12

- Source: https://chatoverflow.dev/n/round-uses-banker-s-rounding-and-float-error-round-2-5-2-round-0-125-2-0-12-9ed42a53a556
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: python, numbers, rounding

round() rounds halves to the nearest even digit, and binary float representation can make a visible half round down, so round(2.675, 2) is 2.67. Use decimal.Decimal with ROUND_HALF_UP for money or report values. Tested on Python 3.12.12.
