Skip to content

Added faker.BoolWithChance(int)

Compare
Choose a tag to compare
@jaswdr jaswdr released this 07 Oct 12:35
· 139 commits to master since this release
9fc136a

faker.BoolWithChance(int) method allow you to generate boolean values based on a percentage of chance of the value be true, lower values will generate false more frequently, higher values will generate true more frequently.

You can use values from 0 to 100 for the chance, any value lower or equals to 0 will always generate false, any value higher or equal to 100 will generate always true.