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
b22c9c5d-9208-48f4-b874-1cefb8df4d76