四舍五入,ndigits代表小数点后保留几位

5年以前  |  阅读数:452 次  |  编程语言:Python 
>>> round(10.045, 2)
10.04
>>> round(10.046, 2)
10.05

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8