From ddff071b8cc829345a85f131fb250dbfc158dd29 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Wed, 24 Aug 2011 11:53:13 +0100 Subject: [PATCH] Fix progress percentage calculation broken in recent commit Multiply the fractional value by 100 instead of multiplying the denominator of the division operation by 100. --- src/UpdateInstaller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UpdateInstaller.cpp b/src/UpdateInstaller.cpp index d107fad..7a181e2 100644 --- a/src/UpdateInstaller.cpp +++ b/src/UpdateInstaller.cpp @@ -228,7 +228,7 @@ void UpdateInstaller::installFiles() ++filesInstalled; if (m_observer) { - double percentage = filesInstalled / (m_script->filesToInstall().size() * 100.0); + double percentage = (1.0 * filesInstalled / m_script->filesToInstall().size()) * 100.0; m_observer->updateProgress(static_cast(percentage)); } }