round round

傳回引數最接近的整數值,並會將四捨五入連結至正無限。

類別

數學

函式語法

round(<parameters>)

參數

  • 小數
  • 整數

簽章與傳回型別

round(<decimal>)

round(<integer>)

傳回整數。

範例

round(3.14)

傳回3。

round(3.54)

傳回4。

round(-3.14)

傳回–3。

round(3)

傳回3。

recommendation-more-help
4f4a00c1-77c9-4eee-84df-bbe6206c3ab9