round

round(Number): Number

数値を最も近い整数に丸めます。

パラメーター

名前 説明

number

評価する数値。

パラメーター

名前 説明

number

丸める数値。

次の例では、小数を最も近い整数に丸めます。

ソース

%dw 2.0
output application/json
---
[ round(1.2), round(4.6), round(3.5) ]

出力

[ 1, 5, 4 ]