Number Settings
Three options control number generation: numberMin, numberMax, and numberFloat.
Bounds
Both bounds are inclusive. By default numbers are integers between 1 and 1000:
Bounds apply to every number in the object graph, at any nesting depth:
Inverted bounds are auto-fixed
If numberMin > numberMax, Forger does not throw: the maximum becomes numberMin + 100.
The rule protects generation from typos; tests that rely on it should instead pass a correct range.
Fractional numbers
Set numberFloat: true for fractional output; the default false floors the value:
Fractional generation applies everywhere numbers appear, including array elements and nested objects.
Settings reference
Option | Type | Default | Notes |
|---|---|---|---|
|
|
| Inclusive lower bound |
|
|
| Inclusive upper bound; auto-fixed if |
|
|
|
|