summaryrefslogtreecommitdiff
path: root/ui/util.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:05:30 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:05:30 +0200
commitc0fce877c478ddbf71a1b651c789e5ea00a00144 (patch)
treede01b0ae8fd296bd24fbca54a80f2f0ba071d461 /ui/util.cpp
parent3.3 (diff)
downloadFreeFileSync-c0fce877c478ddbf71a1b651c789e5ea00a00144.tar.gz
FreeFileSync-c0fce877c478ddbf71a1b651c789e5ea00a00144.tar.bz2
FreeFileSync-c0fce877c478ddbf71a1b651c789e5ea00a00144.zip
3.4
Diffstat (limited to 'ui/util.cpp')
-rw-r--r--ui/util.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/ui/util.cpp b/ui/util.cpp
index 853bd91b..c611e252 100644
--- a/ui/util.cpp
+++ b/ui/util.cpp
@@ -1,3 +1,9 @@
+// **************************************************************************
+// * This file is part of the FreeFileSync project. It is distributed under *
+// * GNU General Public License: http://www.gnu.org/licenses/gpl.html *
+// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) *
+// **************************************************************************
+//
#include "util.h"
#include <wx/scrolwin.h>
#include <wx/textctrl.h>
@@ -24,7 +30,7 @@ wxString FreeFileSync::formatFilesizeToShortString(const wxLongLong& filesize)
wxString FreeFileSync::formatFilesizeToShortString(const wxULongLong& filesize)
{
return FreeFileSync::formatFilesizeToShortString(filesize.ToDouble());
-};
+}
wxString FreeFileSync::formatFilesizeToShortString(const double filesize)
@@ -85,9 +91,9 @@ wxString FreeFileSync::formatFilesizeToShortString(const double filesize)
}
-wxString FreeFileSync::fromatPercentage(const wxLongLong& dividend, const wxLongLong& divisor)
+wxString FreeFileSync::formatPercentage(const wxLongLong& dividend, const wxLongLong& divisor)
{
- const double ratio = dividend.ToDouble() * 100 / divisor.ToDouble();
+ const double ratio = divisor != 0 ? dividend.ToDouble() * 100 / divisor.ToDouble() : 0;
wxString output = _("%x Percent");
output.Replace(wxT("%x"), wxString::Format(wxT("%3.2f"), ratio), false);
return output;
bgstack15