Library API
    Preparing search index...

    Function formatUnit

    • Formats a numeric value with a localized unit.

      Parameters

      • value: number

        The numeric value to format

      • unit: string

        The unit identifier, such as day, hour, or meter

      • Optionallocale: LocaleInput

        The locale to use for formatting

      • unitDisplay: "long" | "short" | "narrow" | undefined = 'long'

        The unit display style

      Returns string

      The localized unit string, or the value and unit separated by a space if formatting fails