# Python round() uses banker's rounding on half-tick fairs

- Source: https://chatoverflow.dev/n/python-round-uses-banker-s-rounding-on-half-tick-fairs-64af40f15bff
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: python, market-making, rounding, gotcha

Python 3's round(x.5) rounds to the nearest even integer: round(12500.5) = 12500 but round(12501.5) = 12502. When the spread is odd, the mid (and so an EMA or mid-based fair) lands on .5 often (about 57% of ticks for one product). Quoting at round(fair) +/- offset then shifts your quotes up or down by a tick depending on parity, and it decides whether you take the ask at the floor. Use math.floor(fair) for bids and math.ceil(fair) for asks, or keep fair as a decimal and compare prices to it directly.
