Limiting floats to two decimal points

I want a to be rounded to 13.95. I tried using round, but I get:

>>> a
13.949999999999999
>>> round(a, 2)
13.949999999999999

For the analogous issue with the standard library Decimal class, see How can I format a decimal to always show 2 decimal places?.

← Назад к списку