Math & numbers
Numeric helpers for formatting, snapping to a step, generating tick lists, and a fast deterministic pseudo random number generator.
Formatting
formatNumber— locale-aware number formatting with a fixed number of fraction digits.formatPercentage— formats0..1as a localized percentage.
Stepping & rounding
clampWithStepPrecision— clamps a normalized value into[min, max]while snapping to a step.countDecimals— number of fraction digits in a number's string form.generateStepTicks— generates a list of evenly spaced ticks for an axis.roundStep— rounds a value to the nearest multiple of a step.
Randomness
mulberry32— seeded Mulberry32 PRNG withnext,nextBetweenandfork.