summaryrefslogtreecommitdiff
path: root/src/resources/db/unitsdb.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-01 01:26:24 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-01 01:26:24 +0300
commitaca306abdee1921d5536fc1e10aea110f599d471 (patch)
tree75d7cce3b9d66193529b8046139e0060bbcaac65 /src/resources/db/unitsdb.cpp
parent24902ba328260cb496c62e236a644ebb990e3fd4 (diff)
downloadplus-aca306abdee1921d5536fc1e10aea110f599d471.tar.gz
plus-aca306abdee1921d5536fc1e10aea110f599d471.tar.bz2
plus-aca306abdee1921d5536fc1e10aea110f599d471.tar.xz
plus-aca306abdee1921d5536fc1e10aea110f599d471.zip
Use npc currency in buy dialog.
Diffstat (limited to 'src/resources/db/unitsdb.cpp')
-rw-r--r--src/resources/db/unitsdb.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/resources/db/unitsdb.cpp b/src/resources/db/unitsdb.cpp
index 7b56e8721..8746753c6 100644
--- a/src/resources/db/unitsdb.cpp
+++ b/src/resources/db/unitsdb.cpp
@@ -322,6 +322,14 @@ std::string UnitsDb::formatCurrency(const int value)
return formatUnit(value, defaultCurrency);
}
+std::string UnitsDb::formatCurrency(std::string name,
+ const int value)
+{
+ if (mCurrencies.find(name) == mCurrencies.end())
+ name = DEFAULT_CURRENCY;
+ return formatUnit(value, mCurrencies[name]);
+}
+
std::string UnitsDb::formatWeight(const int value)
{
return formatUnit(value, defaultWeight);