Skip to content

Add the option to use short form for the Total Contributions count #729

@jgphilpott

Description

@jgphilpott

Is your feature request related to a problem? Please describe:

Large integers for Total Contributions will start to look squished if the number reaches 1 million or more. Also, some people might like to see the count in short form even if it is less than 1M.

Describe the solution you'd like

You should have the option to display the Total Contributions count in short form, this could default to true.

Here is some example JS code:

function shortNumber(number) {

    const units = ['', 'K', 'M', 'B', 'T']
    let unitIndex = 0

    while (number >= 1000 && unitIndex < units.length - 1) {
        number /= 1000
        unitIndex++
    }

    number = parseFloat(number.toFixed(1))
    unit = units[unitIndex]

    return number + unit

}

This turns 1234 into 1.2k, 1234567 into 1.2M, 1234567890 into 1.2B and so on ...

Describe alternatives you've considered

N/A

Additional context

This problem and solution were originally discussed here: #725 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions