Skip to content

Commit 13a276d

Browse files
authored
Create fileSize.src
1 parent 4275248 commit 13a276d

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tools/fileSize.src

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
fileSize = function(filename)
2+
num = 0
3+
for i in range(0, filename.len - 1)
4+
num = num + (filename[i].code * (i + 1))
5+
end for
6+
7+
num = floor(110000 + 6990000 * (num % 1000 / 1000)) + num % 10
8+
9+
Names = ["b", "Kb", "Mb", "Gb"]
10+
n = floor(num ^ 0.1 / 3) + 1
11+
return round(num / (1000 ^ n), 2) + Names[n]
12+
end function

0 commit comments

Comments
 (0)