我需要一种方法将浮点数舍入到给定的小数位数,但我想总是向下舍入.
例如,而不是
>>> round(2.667, 2) 2.67
我宁愿拥有
>>> round_down(2.667, 2) 2.66
python rounding
python ×1
rounding ×1