Ограничение чисел с плавающей точкой до двух десятичных знаковPython

Программы на Python
Гость
Ограничение чисел с плавающей точкой до двух десятичных знаков

Сообщение Гость »


I want to be rounded to 13.95. I tried using , 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?.


Источник: https://stackoverflow.com/questions/455 ... mal-points

Вернуться в «Python»