mIRC Home    About    Download    Register    News    Help

Print Thread
$bytes 't' switch #269714 22/12/21 05:21 PM
Joined: Jan 2004
Posts: 1,744
maroon Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,744
re: https://forums.mirc.com/ubbthreads.php/topics/269577/edge-cases-with-bytes

I see the new beta shows $bytes().suf showing PB for large inputs. However this has affected the 't' switch, which now outputs the quantity of terabytes, which causes the 't' switch to replicate the behavior of the unmentioned new 'p' switch:

//var -s %a $calc(1*1024^4) | echo -a $bytes(%a,g) vs $bytes(%a,t) vs $bytes(%a,p) vs $bytes(%a).suf

result: 1,024 vs 0.00098 vs 0.00098 vs 1TB
should be: 1,024 vs 1 vs 0.00098 vs 1TB

//var -s %a $calc(1*1024^5) | echo -a $bytes(%a,g) vs $bytes(%a,t) vs $bytes(%a,p) vs $bytes(%a).suf
result: 1,048,576 vs 1 vs 1 vs 1PB
should be: 1,048,576 vs 1,024 vs 1 vs 1PB

Re: $bytes 't' switch [Re: maroon] #269719 23/12/21 08:58 AM
Joined: Dec 2002
Posts: 5,103
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,103
Thanks for testing this. This issue has been fixed for the next beta.