From 85e5013dbdacff9df3cd2dece5cfe8722875ccc3 Mon Sep 17 00:00:00 2001 From: mathiasdm Date: Tue, 7 Apr 2009 20:09:59 +0000 Subject: [PATCH] Fixed overflow problem when calculating monthly usage. It now works well (without getting too wide for the window) up to 1 Tbps. --- apps/desktopgui/src/router/configuration/SpeedHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/desktopgui/src/router/configuration/SpeedHelper.java b/apps/desktopgui/src/router/configuration/SpeedHelper.java index 1cce2f9c0..aec782533 100644 --- a/apps/desktopgui/src/router/configuration/SpeedHelper.java +++ b/apps/desktopgui/src/router/configuration/SpeedHelper.java @@ -23,6 +23,6 @@ public class SpeedHelper { } public static int calculateMonthlyUsage(int kbytes) { - return (kbytes*3600*24*31)/1000000; + return (int) ((((long)kbytes)*3600*24*31)/1000000); } }