Method code for $integer.to_bytes()

[Turn on line numbering]
arg num, @long;

if (num > 1073741824)
    return strfmt("%.1l", num / 1.07374e+09) + (long ? " gigabytes" : " gb");
else if (num > 1048576)
    return strfmt("%.1l", num / 1.04858e+06) + (long ? " megabytes" : " mb");
else if (num > 1024)
    return strfmt("%.1l", num / 1024.0) + (long ? " kilobytes" : " kb");
return num + (long ? " bytes" : " b");

["// Created 26-Mar-1995 as a part of ColdCore, see: @help Credit"]

the Cold Dark