From 7764faad8bf568da82831c1c11c56c94de4611b0 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Tue, 26 Feb 2013 20:52:53 -0500 Subject: [PATCH] Android: Remove the "0" from the float width specifier, apparently 0 is omitted in Java. This caused a MissingFormatWidthException. --- .../edu/berkeley/boinc/utils/BOINCUtils.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/android/BOINC/src/edu/berkeley/boinc/utils/BOINCUtils.java b/android/BOINC/src/edu/berkeley/boinc/utils/BOINCUtils.java index 08c5ccf811..f0aaf63c9d 100644 --- a/android/BOINC/src/edu/berkeley/boinc/utils/BOINCUtils.java +++ b/android/BOINC/src/edu/berkeley/boinc/utils/BOINCUtils.java @@ -37,27 +37,27 @@ public class BOINCUtils { if (fFileSize != 0) { if (fFileSize >= xTera) { - buf = String.format("%0.2f/%0.2f TB", fBytesSent/xTera, fFileSize/xTera); + buf = String.format("%.2f/%.2f TB", fBytesSent/xTera, fFileSize/xTera); } else if (fFileSize >= xGiga) { - buf = String.format("%0.2f/%0.2f GB", fBytesSent/xGiga, fFileSize/xGiga); + buf = String.format("%.2f/%.2f GB", fBytesSent/xGiga, fFileSize/xGiga); } else if (fFileSize >= xMega) { - buf = String.format("%0.2f/%0.2f MB", fBytesSent/xMega, fFileSize/xMega); + buf = String.format("%.2f/%.2f MB", fBytesSent/xMega, fFileSize/xMega); } else if (fFileSize >= xKilo) { - buf = String.format("%0.2f/%0.2f KB", fBytesSent/xKilo, fFileSize/xKilo); + buf = String.format("%.2f/%.2f KB", fBytesSent/xKilo, fFileSize/xKilo); } else { - buf = String.format("%0.0f/%0.0f bytes", fBytesSent, fFileSize); + buf = String.format("%.0f/%.0f bytes", fBytesSent, fFileSize); } } else { if (fBytesSent >= xTera) { - buf = String.format("%0.2f TB", fBytesSent/xTera); + buf = String.format("%.2f TB", fBytesSent/xTera); } else if (fBytesSent >= xGiga) { - buf = String.format("%0.2f GB", fBytesSent/xGiga); + buf = String.format("%.2f GB", fBytesSent/xGiga); } else if (fBytesSent >= xMega) { - buf = String.format("%0.2f MB", fBytesSent/xMega); + buf = String.format("%.2f MB", fBytesSent/xMega); } else if (fBytesSent >= xKilo) { - buf = String.format("%0.2f KB", fBytesSent/xKilo); + buf = String.format("%.2f KB", fBytesSent/xKilo); } else { - buf = String.format("%0.0f bytes", fBytesSent); + buf = String.format("%.0f bytes", fBytesSent); } }