• Converts a number into an abbreviated string representation. For example, 1500 becomes '1.5k', 2000000 becomes '2m', etc.

    Parameters

    • value: number

      The number to be abbreviated.

    Returns string

    The abbreviated string representation of the input number.

    Example

    abbreviatedNumber(1500); // Returns '1.5k'
    abbreviatedNumber(2000000); // Returns '2m'