-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
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)
DenverCoder1
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request