New Badge Component - no long

Is there a reason why the number parameter in the badge is an int and not a long?

2147483647 is already pretty long for a number label if you ask me.

Yes, sounds pretty rare to have a need to display 2,147,483,648 unread messages or similar. Maybe the use case is different?

Also, a JavaScript Number cannot hold integer values larger than 2^53 – 1

I need to display youtube total downloads… ;)

No it`s a library providing totals as long. I have a workaround but was just curious if there were JS reasons.

I assume your workaround is use the String instead?
Additionally, many sites for such large numbers start to shorten it to
10’000 → 10K
4’000’000 → 4M
9’000’000’000 → 9B
etc.
Maybe worth considering.

1 Like

That’s my workaround.
Thank you.

That is the most typical way, but also sounds like localization fundamentally. Maybe there is room for a generic solution for localizing/presenting numbers this way?