@Bool()

New in 2.0

Generate boolean values

Data TypesSince 2.0.0

Parameters

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

Usage

@Bool()

Generate true/false with 2:1 ratio

Example:
@Bool()
Output:
truefalse
@Bool(trueWeight,nullWeight)

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

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

Generate true/false/null with specified null ratio

Example:
@Bool(2:1)
Output:
truetruefalse
@Bool(trueWeight,nullWeight,dict)

Full parameter constructor, see complete parameter documentation

Example:
@Bool(2:1,1:5,1|0)
Output:
1null0
← Back to Function Reference