mIRC Home    About    Download    Register    News    Help

Print Thread
#15406 14/03/03 11:39 PM
Joined: Dec 2002
Posts: 13
M
Murray Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Dec 2002
Posts: 13
This is not a bug, but, why $calc only supports up to 5 decimals? i mean, is there any way to use $calc and get the result with all the decimals? or then retrieve the others? (what i want is to retrieve the exact size of a file)

#15407 15/03/03 08:00 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
$file(path\to\filename).size returns the exact size of the file. No need for $calc at all. Scripts commonly use $bytes($file(filename).size),3).suf to return 15.3MB (omit the ,3 to get a longer form, though still probably only 5 decimals).


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#15408 15/03/03 11:47 PM
Joined: Dec 2002
Posts: 266
Z
Fjord artisan
Offline
Fjord artisan
Z
Joined: Dec 2002
Posts: 266
Even still, $bytes or $file still buggers up for large filesizes, take for example:

Windows says my log file is 3.36GB, yet $bytes($file(logfile)).suf returns -,682,775,219B. I guess that is still a limitation of mIRC's calculations... but it doesn't always 'returns the exact size of the file'. grin


You won't like it when I get angry.
#15409 16/03/03 09:19 PM
Joined: Dec 2002
Posts: 13
M
Murray Offline OP
Pikka bird
OP Offline
Pikka bird
M
Joined: Dec 2002
Posts: 13
Hammer, i know that... but suppose i need the exact size of a file en mb. i use $calc(($file(blah.exe).size / 1024) / 1024) and that only retrieves 5 decimals.. that's it


Link Copied to Clipboard