@alanscodelog/utils
    Preparing search index...

    Function snapNumber

    • The classic Math.round(num / step) * step for snapping numbers to a certain step.

      Can optionally round up ("ceil") or down ("floor").

      Parameters

      • num: number
      • step: number
      • dir: "floor" | "ceil" | "round" = "round"

      Returns number