Im using the directory tool and the size column only shows in bytes. Anyone know how to convert to kb, mb, or gb?
Without looking at @MarqueeCrew solution...
I'd do the following 2 step formula
- Work out the base:
MIN(5,FLOOR(LOG10([Size])/LOG10(1024)))
- Make it pretty:
trim(tostring([Size]/POW(1024, tonumber([SizeNice])),3),".0") + SWITCH(tonumber([SizeNice]), " B", 1, " kB", 2, " MB", 3, " GB", 4, " TB", 5, " PB")
@jonathangonzales,
Please have a sense of humor
http://lmgtfy.com/?q=convert+bytes+to+kb
Cheers,
Mark
So mean.