How to print human readable byte counts

I came across this morning, and having a few minutes, adapted the Java code to Julia:

Being relatively new to Julia, this code is a little clumsy, but I’m sure someone can improve it. If anyone wants to adapt it to support Zetta and Yotta byte values, please do.