round

會自動四捨五入到指定位數。

語法

round(數字,小數點位數)
1
print(round(55.19, 1))
55.2

results matching ""

    No results matching ""