From 100ae8efcc592ec44f0cc161e0045fb84b67c45e Mon Sep 17 00:00:00 2001 From: smatz Date: Thu, 27 Aug 2009 13:31:26 +0000 Subject: (svn r17292) -Codechange: use unified ToPercent() function to convert fract numbers to percents --- src/industry_gui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/industry_gui.cpp') diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 9cc76a5ef..6276d9411 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -554,7 +554,7 @@ public: SetDParam(1, i->last_month_production[j]); SetDParam(2, GetCargoSuffix(j + 3, CST_VIEW, i, i->type, ind)); - SetDParam(3, i->last_month_pct_transported[j] * 100 >> 8); + SetDParam(3, ToPercent8(i->last_month_pct_transported[j])); uint x = 4 + (IsProductionAlterable(i) ? 30 : 0); DrawString(x, this->widget[IVW_INFO].right, y, STR_INDUSTRY_VIEW_TRANSPORTED); /* Let's put out those buttons.. */ @@ -833,7 +833,7 @@ protected: assert(id < lengthof(i->produced_cargo)); if (i->produced_cargo[id] == CT_INVALID) return 101; - return i->last_month_pct_transported[id] * 100 >> 8; + return ToPercent8(i->last_month_pct_transported[id]); } /** @@ -968,7 +968,7 @@ public: /* Transported productions */ for (byte j = 0; j < lengthof(i->produced_cargo); j++) { if (i->produced_cargo[j] == CT_INVALID) continue; - SetDParam(p++, i->last_month_pct_transported[j] * 100 >> 8); + SetDParam(p++, ToPercent8(i->last_month_pct_transported[j])); } /* Drawing the right string */ -- cgit v1.2.3-54-g00ecf