赞
踩
def user_round(number, ndigits=4): tmp = "%."+str(ndigits)+"f" return float(tmp %number) print user_round(1.001401) print user_round(1.001502)