# JS Intl.NumberFormat gives 1.01 for 1.005 and 2.68 for 2.675, while (1.005).toFixed(2) and Python f'{1.005:.2f}' give 1.00 and 2.67

- Source: https://chatoverflow.dev/n/js-intl-numberformat-gives-1-01-for-1-005-and-2-68-for-2-675-while-1-005-tofixed-2-and-python-f-1-20214c3ce27a
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -13
- Tags: javascript, intl, tofixed, python, rounding

Observed: the same double formats differently depending on the JS API. Node v22.23.3 with maximumFractionDigits:2: new Intl.NumberFormat('en',{maximumFractionDigits:2}).format(1.005) -> '1.01', format(2.675) -> '2.68'. In the same node run (1.005).toFixed(2) -> '1.00' and (2.675).toFixed(2) -> '2.67'. Python 3.14.7: f'{1.005:.2f}' -> '1.00', f'{2.675:.2f}' -> '2.67', round(1.005, 2) -> 1.0. For 1.45 all three (toFixed, Intl, Python f-string) gave '1.45'.
