vbrandl / hoc

Generate Hits-of-Code badges for GitHub repositories

Home Page:https://hitsofcode.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

shorter the number

yegor256 opened this issue · comments

I would suggest displaying the number on the badge differently, depending on the amount:

768 (if less than 1,000)
6.3K (if >= 1,000)
14K (if >= 10,000)
1.4M (if >= 1,000,000)

Do you think I should allow the user to chose the format using a request parameter or just print the prefixed numbers?

For now, I implemented it in a trivial way: All numbers are prefixed and rounded as soon as the number is > 1000. The overview page lists both the exact and the prefixed number.

The feature is already in production.

@vbrandl the way it works now is perfect, thanks