mIRC Home    About    Download    Register    News    Help

Print Thread
#207456 17/12/08 04:56 PM
Joined: Oct 2003
Posts: 214
S
Fjord artisan
OP Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 214
Dunno how to describe this and i'm not really sure if it is a bug or not but the result seems wrong to me.

Here the example:
$bytes(1000000000000000000000,3) returns: 9,094
$bytes(1000000000000000000000) returns: 909,494,701.77

And shouldn't $bytes(1,3) return 001?


one step closer to world domination
Sephiroth_ #207458 17/12/08 08:01 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
$bytes(size,3) returns the "3 digit format"-- that means in terms of significant digits, not zero padding. You can use $base($bytes(1,3),10,10,3) if you need specific zero padding, but $bytes(1,3) will not return 001.

The explanation for the first example seems to be that mIRC gives up on 3 digit representation of file sizes in the thousands-of-TB range.. It makes sense if you realize that mIRC would have otherwise switched to the next SI representation (PB, petabyte) when it reaches the 1000's of-- but since PB isn't supported (I imagine), it has nowhere to go.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard