Math
randAggregation
Generate a list of numbers that add up to a total value.
import { randAggregation } from '@ngneat/falso';
randAggregation() // default values is 2 and totalValue is 100
randAggregation({ values: 3, totalValue: 1500, length: 10 })
randAggregation({ values: 3 })
Live Editor
Result
Loading...
randBinary
Generate a random binary.
import { randBinary } from '@ngneat/falso';
randBinary()
randBinary({ length: 10 })
Live Editor
Result
Loading...
randFloat
Generate a random float.
import { randFloat } from '@ngneat/falso';
randFloat()
randFloat({ length: 10 })
randFloat({ min: 10, max: 20, fraction: 1 }) // 12.5
randFloat({ min: 10, max: 20, fraction: 2 }) // 12.52
Live Editor
Result
Loading...
randNumber
Generate a random number.
import { randNumber } from '@ngneat/falso';
randNumber()
randNumber({ length: 10 })
randNumber({ min: 10, max: 1000 }) // default is 'min': 0, 'max': 999_999
randNumber({ min: 0.1, max: 1, fraction: 2 }) // 0.37
randNumber({ min: 1000, max: 100000, precision: 1000 }) // 67_000
randNumber({ min: 1000, max: 2000, precision: 100 }) // 1_200
randNumber({ min: 1000, max: 2000, precision: 10 }) // 1_250
Live Editor
Result
Loading...
randOctal
Generate a random octal.
import { randOctal } from '@ngneat/falso';
randOctal()
randOctal({ length: 10 })
Live Editor
Result
Loading...