Index: ps/trunk/binaries/data/mods/public/gui/summary/layout.js =================================================================== --- ps/trunk/binaries/data/mods/public/gui/summary/layout.js +++ ps/trunk/binaries/data/mods/public/gui/summary/layout.js @@ -151,7 +151,7 @@ "headings": [ { "identifier": "playername", "caption": translate("Player name"), "yStart": 26, "width": 200 }, { "identifier": "tradeIncome", "caption": translate("Trade income"), "yStart": 16, "width": 100 }, - { "identifier": "barterEfficency", "caption": translate("Barter efficiency"), "yStart": 16, "width": 100 }, + { "identifier": "barterEfficency", "caption": translate("Barter efficiency"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, ...g_ResourceData.GetResources().map(res => { return { "identifier": res.code, @@ -183,11 +183,11 @@ "headings": [ { "identifier": "playername", "caption": translate("Player name"), "yStart": 26, "width": 200 }, { "identifier": "killDeath", "caption": translate("Kill / Death ratio"), "yStart": 16, "width": 100, "format": "DECIMAL2" }, - { "identifier": "mapControlPeak", "caption": translate("Map control (peak)"), "yStart": 16, "width": 100 }, - { "identifier": "mapControl", "caption": translate("Map control (finish)"), "yStart": 16, "width": 100 }, - { "identifier": "mapExploration", "caption": translate("Map exploration"), "yStart": 16, "width": 100 }, - { "identifier": "vegetarianRatio", "caption": translate("Vegetarian ratio"), "yStart": 16, "width": 100 }, - { "identifier": "feminization", "caption": translate("Feminization"), "yStart": 16, "width": 100 }, + { "identifier": "mapControlPeak", "caption": translate("Map control (peak)"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, + { "identifier": "mapControl", "caption": translate("Map control (finish)"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, + { "identifier": "mapExploration", "caption": translate("Map exploration"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, + { "identifier": "vegetarianRatio", "caption": translate("Vegetarian ratio"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, + { "identifier": "feminization", "caption": translate("Feminization"), "yStart": 16, "width": 100, "format": "PERCENTAGE" }, { "identifier": "bribes", "caption": translate("Bribes"), Index: ps/trunk/source/gui/CChart.cpp =================================================================== --- ps/trunk/source/gui/CChart.cpp +++ ps/trunk/source/gui/CChart.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2019 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -270,7 +270,7 @@ else if (format == L"INTEGER") { wchar_t buffer[64]; - swprintf(buffer, 64, L"%d", static_cast(value)); + swprintf(buffer, 64, L"%d", std::lround(value)); gui_str.SetValue(buffer); } else if (format == L"DURATION_SHORT") @@ -280,6 +280,12 @@ swprintf(buffer, 64, L"%d:%02d", seconds / 60, seconds % 60); gui_str.SetValue(buffer); } + else if (format == L"PERCENTAGE") + { + wchar_t buffer[64]; + swprintf(buffer, 64, L"%d%%", std::lround(value)); + gui_str.SetValue(buffer); + } else { LOGERROR("Unsupported chart format: " + format.EscapeToPrintableASCII());