Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 485 Bytes

dw-core-functions-random.adoc

File metadata and controls

33 lines (22 loc) · 485 Bytes

random

random(): Number

Returns a pseudo-random number greater than or equal to 0.0 and less than 1.0.

Example

This example generates a pseudo-random number and multiplies it by 1000.

Source

%dw 2.0
output application/json
---
{ price: random() * 1000 }

Output

{ "price": 65.02770292248383 }