From 60a663ef58dfed6f84d613942266b397d61cb420 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Tue, 6 Mar 2018 16:14:29 +0300 Subject: [PATCH] Account for all possible count values in getCountString (Bug #4346) --- apps/openmw/mwgui/itemwidget.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/itemwidget.cpp b/apps/openmw/mwgui/itemwidget.cpp index a31eb9c76..e793dbf58 100644 --- a/apps/openmw/mwgui/itemwidget.cpp +++ b/apps/openmw/mwgui/itemwidget.cpp @@ -16,7 +16,12 @@ namespace { if (count == 1) return ""; - if (count > 9999) + + if (count > 999999999) + return MyGUI::utility::toString(int(count/1000000000.f)) + "b"; + else if (count > 999999) + return MyGUI::utility::toString(int(count/1000000.f)) + "m"; + else if (count > 9999) return MyGUI::utility::toString(int(count/1000.f)) + "k"; else return MyGUI::utility::toString(count);