Style fixes.

This commit is contained in:
Slawomir Wojciech Wojtczak (vermaden) 2012-09-04 10:36:39 +02:00
parent e15bada9b3
commit 1f232a46de
1 changed files with 7 additions and 7 deletions

14
beadm
View File

@ -183,13 +183,13 @@ case ${1} in
return substr(v, 1, length(v) - 1) * multiplier[substr(v, length(v))] return substr(v, 1, length(v) - 1) * multiplier[substr(v, length(v))]
} }
function show_units(v) { function show_units(v) {
if(v <= 1024) { unit = "K"; } if(v <= 1024) { unit = "K"; }
else if(v <= 1048576) { v = v / 1024; unit = "M"; } else if(v <= 1048576) { v = v / 1024; unit = "M"; }
else if(v <= 1073741824) { v = v / 1048576; unit = "G"; } else if(v <= 1073741824) { v = v / 1048576; unit = "G"; }
else if(v <= 1099511627776) { v = v / 1073741824; unit = "T"; } else if(v <= 1099511627776) { v = v / 1073741824; unit = "T"; }
else if(v <= 1125899906842624) { v = v / 1099511627776; unit = "P"; } else if(v <= 1125899906842624) { v = v / 1099511627776; unit = "P"; }
else if(v <= 1152921504606846976) { v = v / 1125899906842624; unit = "E"; } else if(v <= 1152921504606846976) { v = v / 1125899906842624; unit = "E"; }
else { v = v / 1152921504606846976; unit = "Z"; } else { v = v / 1152921504606846976; unit = "Z"; }
fmt = "%.1f" fmt = "%.1f"
return sprintf(fmt "%s", v, unit) return sprintf(fmt "%s", v, unit)
} }