88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
return [join $desc {, }]
}
proc pretty_print_size {size} {
foreach unit [list "" K M G T P] {
if {$size < 1024} {
if {$size < 10} {
set size [expr {round($size * 10) / 10.0}]
} else {
set size [expr {round($size)}]
}
return "$size [string trim ${unit}B]"
}
|
|
|
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
return [join $desc {, }]
}
proc pretty_print_size {size} {
foreach unit [list "" K M G T P] {
if {$size < 1024} {
if {$size < 10 && $unit != ""} {
set size [expr {round($size * 10) / 10.0}]
} else {
set size [expr {round($size)}]
}
return "$size [string trim ${unit}B]"
}
|