fileSize = function(filename) num = 0 for i in range(0, filename.len - 1) num = num + (filename[i].code * (i + 1)) end for num = floor(110000 + 6990000 * (num % 1000 / 1000)) + num % 10 Names = ["b", "Kb", "Mb", "Gb"] n = floor(num ^ 0.1 / 3) + 1 return round(num / (1000 ^ n), 2) + Names[n] end function