1372 -> 1.3 K
2023150 -> 2 M
5430120215 -> 5.4 B
I found this solution: http://stackoverflow.com/questions/4371059/shorten-long-numbers-to-k-m-b/4371114#4371114
How could I incorporate that into SMF?
As I mentioned on Google Chat - in case anyone else is interested in the answer that I provided. You would need to specify where exactly you would want to incorporate this, there isn't a viable method to convert all numbers into formats as such.
Because comma_format totally isn't a thing that would be the ideal place to do this.
Tricky...
It depends really on where that comes from. Inside posts should be difficult, maybe using a custom BBC for it, but that also requires you to add BBC tags around the numbers you want to "shorten".
Outside the posts you can hack "function comma_format" --> Subs.php but I can't really tell if this is used everywhere...
edit: ninja'd :P
It's used everywhere that's actually important because it's what also does number formatting, in a manner that doesn't depend on setlocale settings.
So, can this be done via the comma_format function?
With a non trivial rewrite of it, sure.