Rounds a number to the nearest positional notation index (or the nearest place value).

// Returns 1240
const rounded = Chalkboard.numb.roundTo(1237, 10);
  • Parameters

    • num: number

      Number

    • positionalIndex: number

      The positional notation index (or place value)

    Returns number