Simplifying a Number

Posted by Rene on Tue 06 Feb 2018 12:46 AM — 2 posts, 11,958 views.

#0
I'm looking for a way of taking a number between 0-10000000 an shortening it to only show the first 3 digits, then a letter representing the rest, i.e. 9804432 will be 9.80m (or 9.8m), 435432 will be 435k, and 4213 would be 4.21k, what is a good way to go about doing so?
Thanks.
Australia Forum Administrator #1
A couple of "if" tests to establish what range the number falls into, then a string.format on the resulting number (possibly divided by 1000 or 1000000 first).