summaryrefslogtreecommitdiff
path: root/src/resources/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/db')
-rw-r--r--src/resources/db/unitsdb.cpp15
-rw-r--r--src/resources/db/unitsdb.h7
2 files changed, 21 insertions, 1 deletions
diff --git a/src/resources/db/unitsdb.cpp b/src/resources/db/unitsdb.cpp
index aac6b72e3..a32786b84 100644
--- a/src/resources/db/unitsdb.cpp
+++ b/src/resources/db/unitsdb.cpp
@@ -325,6 +325,12 @@ std::string UnitsDb::formatCurrency(const int value)
return formatUnit(value, defaultCurrency);
}
+std::string UnitsDb::formatCurrency64(const int64_t value)
+{
+ return formatUnit(CAST_S32(value),
+ defaultCurrency);
+}
+
std::string UnitsDb::formatCurrency(std::string name,
const int value)
{
@@ -333,6 +339,15 @@ std::string UnitsDb::formatCurrency(std::string name,
return formatUnit(value, mCurrencies[name]);
}
+std::string UnitsDb::formatCurrency64(std::string name,
+ const int64_t value)
+{
+ if (mCurrencies.find(name) == mCurrencies.end())
+ name = DEFAULT_CURRENCY;
+ return formatUnit(CAST_S32(value),
+ mCurrencies[name]);
+}
+
std::string UnitsDb::formatWeight(const int value)
{
return formatUnit(value, defaultWeight);
diff --git a/src/resources/db/unitsdb.h b/src/resources/db/unitsdb.h
index 0681567c0..859adaabc 100644
--- a/src/resources/db/unitsdb.h
+++ b/src/resources/db/unitsdb.h
@@ -46,11 +46,16 @@ namespace UnitsDb
*/
std::string formatCurrency(const int value) A_WARN_UNUSED;
+ std::string formatCurrency64(const int64_t value) A_WARN_UNUSED;
+
/**
* Formats the given number in the correct currency format.
*/
std::string formatCurrency(std::string name,
- const int value) A_WARN_UNUSED;
+ const int value) A_WARN_UNUSED;
+
+ std::string formatCurrency64(std::string name,
+ const int64_t value) A_WARN_UNUSED;
/**
* Formats the given number in the correct weight/mass format.