From 3df044e3ffd9a8dd5cd5a28fae3af28cfaaf8cdd Mon Sep 17 00:00:00 2001 From: Alexander van Gessel Date: Mon, 3 Nov 2008 04:02:36 +0100 Subject: [PATCH] State filesizes in proper SI-notation. --- attic/wesnoth-pngcrush | 4 ++-- data/tools/addon_manager/html.py | 4 ++-- src/hotkeys.cpp | 2 +- src/network.cpp | 2 +- utils/weblist.pl | 2 +- utils/wesnoth-optipng | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/attic/wesnoth-pngcrush b/attic/wesnoth-pngcrush index cab09d10376..d6af5a3012b 100755 --- a/attic/wesnoth-pngcrush +++ b/attic/wesnoth-pngcrush @@ -56,10 +56,10 @@ files.each { | file| totalSavedBytes = totalSavedBytes + savedBytes totalSavedFiles = totalSavedFiles.succ output = `mv "#{file}.new.png" -v "#{file}"` - puts ",\nsaved: #{savedBytes} bytes, total saved: #{totalSavedBytes/1024} KB" + puts ",\nsaved: #{savedBytes} bytes, total saved: #{totalSavedBytes/1024} KiB" else File.unlink("#{file}.new.png"); end } -puts "\ntotal saved: #{totalSavedBytes/1024} KB, #{totalSavedFiles} files\n"; +puts "\ntotal saved: #{totalSavedBytes/1024} KiB, #{totalSavedFiles} files\n"; diff --git a/data/tools/addon_manager/html.py b/data/tools/addon_manager/html.py index 24e85a3ad0d..d6846d8fc93 100644 --- a/data/tools/addon_manager/html.py +++ b/data/tools/addon_manager/html.py @@ -90,8 +90,8 @@ Select the add-on you want to install from the list and click "OK". The download w("%s
" % name) w("Version: %s
" % v("version", "unknown")) w("Author: %s" % v("author", "unknown")) - MB = 1024 * 1024 - w("%.2fMB" % (float(v("size", "unknown")) / MB)) + MiB = 1024 * 1024 + w("%.2fMiB" % (float(v("size", "unknown")) / MiB)) if url: link = url.rstrip("/") + "/" + v("name") + ".tar.bz2" w("
download" % link) diff --git a/src/hotkeys.cpp b/src/hotkeys.cpp index b3e6ab36fcf..02dfeb59956 100644 --- a/src/hotkeys.cpp +++ b/src/hotkeys.cpp @@ -898,7 +898,7 @@ void execute_command(display& disp, HOTKEY_COMMAND command, command_executor* ex int size = disp.screenshot(filename, map_screenshot); if (size > 0) { std::stringstream res; - res << filename << " ( " << size/1000000 <<" "<< (size/1000)%1000 << " KB )"; + res << filename << " ( " << size/1000000 <<" "<< (size/1000)%1000 << " kB )"; gui::dialog(disp,_("Screenshot done"),res.str(),gui::MESSAGE).show(); } else gui::dialog(disp,_("Screenshot failed"),"",gui::MESSAGE).show(); diff --git a/src/network.cpp b/src/network.cpp index ac4fff8f415..411f1d0fb3f 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -974,7 +974,7 @@ std::string get_bandwidth_stats(int hour) ss << "Hour stat starting from " << hour << "\n " << std::left << std::setw(bandwidth_stats::type_width) << "Type of packet" << "| " << std::setw(bandwidth_stats::packet_width)<< "out #" << "| " - << std::setw(bandwidth_stats::bytes_width) << "out kb" << "| " + << std::setw(bandwidth_stats::bytes_width) << "out kb" << "| " /* Are these bytes or bits? base10 or base2? */ << std::setw(bandwidth_stats::packet_width)<< "in #" << "| " << std::setw(bandwidth_stats::bytes_width) << "in kb" << "\n"; diff --git a/utils/weblist.pl b/utils/weblist.pl index b75632247d1..8b8ad66af65 100755 --- a/utils/weblist.pl +++ b/utils/weblist.pl @@ -250,7 +250,7 @@ foreach my $campaign (@sorted) { $size += 512; $size -= $size % 1024; $size /= 1024; - push @row, escapeHTML("$size KB"); + push @row, escapeHTML("$size KiB"); push @row, escapeHTML($campaign->{'attr'}->{'downloads'}); push @rows, td(\@row); } diff --git a/utils/wesnoth-optipng b/utils/wesnoth-optipng index 66baf7d6881..dd4619473d9 100755 --- a/utils/wesnoth-optipng +++ b/utils/wesnoth-optipng @@ -89,7 +89,7 @@ optimize_imgfile() total_savings_size=$((${total_savings_size}+${png_savings_size})) total_savings_filecount=$((1+${total_savings_filecount})) mv -f ${1}.new ${1} - echo " saved: ${png_savings_size} bytes, total saved: $((${total_savings_size}/1024)) KB" + echo " saved: ${png_savings_size} bytes, total saved: $((${total_savings_size}/1024)) KiB" else rm -f ${1}.new echo " already optimized" @@ -106,9 +106,9 @@ print_statistics() # Print overall statistics if [ "$total_savings_filecount" -gt 0 ]; then echo "Overall statistics (only for files with a smaller recompressed size):" - echo " Original size: $((${total_original_size}/1024)) KB on ${total_savings_filecount} files" - echo " Optimized size: $(((${total_original_size}-${total_savings_size})/1024)) KB" - echo " Total saving: $((${total_savings_size}/1024)) KB = $((${total_savings_size}*100/${total_original_size}))% decrease" + echo " Original size: $((${total_original_size}/1024)) KiB on ${total_savings_filecount} files" + echo " Optimized size: $(((${total_original_size}-${total_savings_size})/1024)) KiB" + echo " Total saving: $((${total_savings_size}/1024)) KiB = $((${total_savings_size}*100/${total_original_size}))% decrease" else echo "No files were recompressed." fi