From 54537c66b0bbaf3ed13d049097a5c7a06612586c Mon Sep 17 00:00:00 2001 From: spx Date: Thu, 9 Dec 2010 06:05:17 +0000 Subject: [PATCH] Code cleanup. --- Library/Measure.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Library/Measure.cpp b/Library/Measure.cpp index eb3ba3f6..9b4c9311 100644 --- a/Library/Measure.cpp +++ b/Library/Measure.cpp @@ -524,7 +524,7 @@ const WCHAR* CMeasure::GetStringValue(bool autoScale, double scale, int decimals } else { - double val = GetValue() * (1.0 / scale); + double val = GetValue() / scale; if(decimals == 0) { @@ -536,7 +536,7 @@ const WCHAR* CMeasure::GetStringValue(bool autoScale, double scale, int decimals swprintf(buffer, L"%.5f", val); size_t len = wcslen(buffer); - if (len >= 6 && wcscmp(buffer + len - 6, L".00000") == 0) + if (len >= 6 && wcscmp(&buffer[len - 6], L".00000") == 0) { buffer[len - 6] = L'\0'; } @@ -568,17 +568,17 @@ void CMeasure::GetScaledValue(int decimals, double theValue, WCHAR* buffer) if(theValue > 1000.0 * 1000.0 * 1000.0 * 1000.0) { wcscat(format, L" T"); - value = theValue / 1024.0 / 1024.0 / 1024.0 / 1024.0; + value = theValue / (1024.0 * 1024.0 * 1024.0 * 1024.0); } else if(theValue > 1000.0 * 1000.0 * 1000.0) { wcscat(format, L" G"); - value = theValue / 1024.0 / 1024.0 / 1024.0; + value = theValue / (1024.0 * 1024.0 * 1024.0); } else if(theValue > 1000.0 * 1000.0) { wcscat(format, L" M"); - value = theValue / 1024.0 / 1024.0; + value = theValue / (1024.0 * 1024.0); } else if(theValue > 1000.0) {