Stackoverflow
This is most likely a very, very simple solution but my tired brain simply can't come up with it.
As the title suggests, I'd like to write a function that's able to convert a number like:
493205
Into a string of:
"49g 32s 5c"
What would be the most logical way of doing this?
Quick one-liner, assuming $x holds the integer value:
modulo 100 gives us the last two digits, and dividing by 100 “removes” the last two digits from the number. (Technically, it gives a float, but using modulo on that again forces integer conversion first.)