先转为字符串,再用rstrip去除末尾0,再把字符串转回float。 num = float(str(float(num)).rstrip('0')) ...全文. t59616. 2015-11-10 TA获得超过784个赞. > ...
確定! 回上一頁