I’ve never been particularly good at math. Sometimes, the numbers get challenging to keep straight, especially when moving in orders of magnitude from one value to another. But, when working with large numbers, I typically codify conversion code to help ease the mental burden of keeping everything straight. I know I need to act, especially once scientific notation shows in my output results.
So, in this post, I’ve written a helper class that helps convert from bytes to kilobytes, megabytes, gigabytes, and terabytes.