%dw 2.0
output application/json
---
[ round(1.2), round(4.6), round(3.5) ]
DataWeave
round
round(Number): Number
Rounds a number up or down to the nearest whole number.
Parameters
Name | Description |
---|---|
|
The number to evaluate. |
Parameters
Name | Description |
---|---|
|
The number to round. |
Example
This example rounds decimal numbers to the nearest whole numbers.
Source
Output
[ 1, 5, 4 ]
JSON