kit
    Preparing search index...

    Function round

    • Round a number to the given amount of decimals (none by default)

      The result is a number, so round(1.1, 2) gives 1.1: pass trailingZeroes to get the formatted string with the trailing zeroes instead ("1.10").

      Parameters

      • number: number
      • Optionaldecimals: number | "" | null

        default 0

      • OptionaltrailingZeroes: AnythingFalsy

        Whether to return a string keeping the trailing zeroes

      Returns number

    • Round a number to the given amount of decimals (none by default)

      The result is a number, so round(1.1, 2) gives 1.1: pass trailingZeroes to get the formatted string with the trailing zeroes instead ("1.10").

      Parameters

      • number: number
      • decimals: number | "" | null | undefined

        default 0

      • trailingZeroes: true | 1

        Whether to return a string keeping the trailing zeroes

      Returns string

    • Round a number to the given amount of decimals (none by default)

      The result is a number, so round(1.1, 2) gives 1.1: pass trailingZeroes to get the formatted string with the trailing zeroes instead ("1.10").

      Parameters

      • number: number
      • Optionaldecimals: number | "" | null

        default 0

      • OptionaltrailingZeroes: boolean | 1 | AnythingFalsy

        Whether to return a string keeping the trailing zeroes

      Returns string | number