@Bool()

New in 2.0

Generate boolean values

Data TypesSince 2.0.0

Parameters

NameTypeRequiredDefaultDescription
trueWeightTrue ratio, e.g. "2:1" means 2 true per 3 values on average
nullSamplerThe null ratio, such as "1:2", indicates that generating a random value 3 times with an average of 1 time is null
dictBoolean dictionary values separated by "|", first=true, second=false. Default: true|false

Usage

@Bool(arg0,arg1,arg2)

Full parameter constructor, see complete parameter documentation

Example:
@Bool(2:1,1:5,1|0)
Output:
1null0
@Bool(arg0,arg1)

Generate true/false/null with specified true and null ratios

Example:
@Bool(2:1,1:5)
Output:
truenullfalse
@Bool(arg0)

Generate true/false/null with specified null ratio

Example:
@Bool(2:1)
Output:
truetruefalse
@Bool()

Generate true/false with 2:1 ratio

Example:
@Bool()
Output:
truefalse
← Back to Function Reference