@jossmac/lil-libs
    Preparing search index...

    Function roundToStep

    • Rounds a number to the nearest step interval.

      • value: number

        Number to round.

      • step: number

        Interval to snap to; must be finite and non-zero.

      The nearest multiple of step to value.

      roundToStep(5.26, 0.25); // 5.25
      roundToStep(-5.26, 0.25); // -5.25

      When step is 0, or fails the isFiniteNumber guard.