Searched everywhere for help.. hopfully one of you guys can help me out
It'd be much appriciated.
Code: Select all
if {[expr $upload / 1024] >= 1} {
set uploaded "[string range "[expr $upload / 1024.0]" 0 [expr [string length "[expr $upload / 1024]"]+ 2] ] KB"};
if {[expr $upload / 1048576] >= 1} {
set uploaded "[string range "[expr $upload / 1048576.0]" 0 [expr [string length "[expr $upload / 1048576]"]+ 2] ] MB"};
if {[expr $upload / 1073741824] >= 1} {
set uploaded "[string range "[expr $upload / 1073741824.0]" 0 [expr [string length "[expr $upload / 1073741824]"]+ 2] ] GB"};
if {[expr $upload / 1099511627776] >= 1} {
set uploaded "[string range "[expr $upload / 1099511627776.0]" 0 [expr [string length "[expr $upload / 1099511627776]"]+ 2] ] TB"};
if {[expr $download / 1024] >= 1} {
set downloaded "[string range "[expr $download / 1024.0]" 0 [expr [string length "[expr $download / 1024]"]+ 2] ] KB"};
if {[expr $download / 1048576] >= 1} {
set downloaded "[string range "[expr $download / 1048576.0]" 0 [expr [string length "[expr $download / 1048576]"]+ 2] ] MB"};
if {[expr $download / 1073741824] >= 1} {
set downloaded "[string range "[expr $download / 1073741824.0]" 0 [expr [string length "[expr $download / 1073741824]"]+ 2] ] GB"};
if {[expr $download / 1099511627776] >= 1} {
set downloaded "[string range "[expr $download / 1099511627776.0]" 0 [expr [string length "[expr $download / 1099511627776]"]+ 2] ] TB"};
When these lines are called.. i get an error like this..
I've isolated it to these lines only.. if i comment them out.. it works flawlessly.. cept displayed in bytes[12:53] <ServBot> [12:53] Tcl error [user_search]: integer value too large to represent
One other thing i noticed is, if i comment out the GB and TB lines and leave KB and MB.. it works for anything under a Gig..
anything over a gig it just returns that error again
Any help would be nice.. thanks in advance..
Matt