augment-vir - v31.17.1
    Preparing search index...

    Function round

    • Round a value to the given number of decimal digits. If no decimal value is present, or if undefined digits are given, no rounding occurs.

      Parameters

      • value: number
      • __namedParameters: { digits: undefined | number }
        • digits: undefined | number

          The number of digits to round to. Set to undefined to disable rounding.

      Returns number

      import {round} from '@augment-vir/common';

      // `result1` is `5.13`
      const result1 = round(5.125, {digits: 2});
      // `result2` is `5`
      const result2 = round(25, {digits: 2});