python float 截取

2022-06-09  本文已影响0人  王国的荣耀

python float 保留两位小数点

from datetime import timedelta
from decimal import Decimal

percent = success/total
 percent = percent*100
 percent = Decimal(percent).quantize(Decimal('0.00'))
上一篇下一篇

猜你喜欢

热点阅读