Use letters to make numbers shorter Challenge
Take a number and output it with 4 digits or less using letters and numbers. For example; 270,030 would turn into 270K.
Key
Billion -&gt; B
Million -&gt; M
Thousand -&gt; K
Rules

You may choose to accept input numbers that include commas delimiting every three decimal places (such as 123,456,789).
Round to nearest, half-up.
Numbers will only go up to 999,499,999,999 .
The mantissa part of the answer should be at least 1.
All letters must be uppercase and as specified above.
Outputs must be 4 or less digits. (including letters such as B, K, and M)
Outputs must be as mathematically precise as possible. Example:

15,480 -&gt; 20K NOT OK
15,480 -&gt; 15.5K GOOD


If there are multiple outputs with the same mathematical precision, return either one. Example:

1000 -&gt; 1000 GOOD
1000 -&gt; 1K GOOD



Examples:

1,234,567 -> 1.23M
999,500 -> 1M
999,499 -> 999K
102 -> 102
1000 -> 1K
1001 -> 1001
100,000 -> 100K
12,345,678,912 -> 12.3B
1,452,815,612 -> 1.45B

Submissions

This is code-golf, so the shortest solution in each language wins
Standard Loopholes Apply
JavaScript, 84 79 bytes



i=&gt;{I=i;for(x=-1;i&gt;=999.5;x++)i/=1e3;return I&lt;1e4?I:+i.toPrecision(3)+'KMB'[x]}


Try it online!

(Takes inputs as numbers)

Special cases the first one where if i &lt; 1000, the number itself is always one of the shortest ways, if not the only shortest way.

Otherwise, it divides it by 1000 until dividing it would make it have no sigificant figures above 1, and chooses a suffix based on how many divisions were done.