%dw 2.0
output application/json
---
[ (3 mod 2), (4 mod 2), (2.2 mod 2) ]
DataWeave
mod
mod(Number, Number): Number
Returns the modulo (the remainder after dividing the dividend
by the divisor
).
Parameters
Name | Description |
---|---|
|
The number that serves as the dividend for the operation. |
|
The number that serves as the divisor for the operation. |
Example
This example returns the modulo of the input values. Note that you can also
use the mod(dividend, divisor)
notation (for example, mod(3, 2)
to return
1
).
Source
Output
[ 1, 0, 0.2]
JSON