# [Python 2], 84 bytes <!-- language-all: lang-python --> i=input()[::-1];o="" for x in"kMGT ":o+=(i,i[0:3]+x)[len(i)>3];i=i[3:] print o[::-1] [Try it online!][TIO-k1m542z5] [Python 2]: https://docs.python.org/2/ [TIO-k1m542z5]: https://tio.run/##ZY3LDoIwEEX3/YpmNrSiCVDxUVK3rty5a7rCGiealhBM8OsrBh8Im3vPmWRmqkdz8S4LpT9ZqmgURQEVuureMK6lXKSm8AqAnH1NW4oOrof9kYL0sWI4R51IYeKW65t1DPlOmKJb10IaUtXoGur7I6E7TGxrS/Z6xGdpHiDNgHQh@ly@K//06gvrH20GuB1y8icjG@vEp4MEng "Python 2 – Try It Online" - Reverse the input - Step through in threes appending the next letter - Reverse and print Not sure that this is the most efficient approach but it's the best I can come up with at the moment.