npm.nicfv.com

    Function round2

    • Round a number to the nearest multiple of an arbitrary base. Does not round when the base is set to zero.

      Parameters

      • n: number

        Any number to round

      • base: number

        Any base to round to

      Returns number

      n rounded to the nearest multiple of base

      const y = SMath.round2(Math.PI, 0.2); // 3.2
      
    MMNEPVFCICPMFPCPTTAAATR