Fork me on GitHub

Someone has recently ask about converting a number to a string with the correct size suffix (KB, MB etc). Not sure in what channel and can't find it again because we still use Slack, so posting it here. Just stumbled upon this article that explains how most of the code that does it is wrong: It's pretty neat.