diff options
author | rubidium42 <rubidium@openttd.org> | 2021-04-28 16:46:24 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-05-13 23:13:17 +0200 |
commit | 65cbde4b30f8fdf6d4cf1196f6a596a5550c9aee (patch) | |
tree | 180f29871d8401d18dce5ae92f196832b34fe0bc /src/strings.cpp | |
parent | 2022e3482417eceeb1045d01c2aa64db42f03f08 (diff) | |
download | openttd-65cbde4b30f8fdf6d4cf1196f6a596a5550c9aee.tar.xz |
Codechange: move currency settings to std::string
Diffstat (limited to 'src/strings.cpp')
-rw-r--r-- | src/strings.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/strings.cpp b/src/strings.cpp index 3c2c07bde..b5cb59d20 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -486,7 +486,7 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, Money n /* Add prefix part, following symbol_pos specification. * Here, it can can be either 0 (prefix) or 2 (both prefix and suffix). * The only remaining value is 1 (suffix), so everything that is not 1 */ - if (spec->symbol_pos != 1) buff = strecpy(buff, spec->prefix, last); + if (spec->symbol_pos != 1) buff = strecpy(buff, spec->prefix.c_str(), last); /* for huge numbers, compact the number into k or M */ if (compact) { @@ -502,7 +502,7 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, Money n } const char *separator = _settings_game.locale.digit_group_separator_currency.c_str(); - if (StrEmpty(separator)) separator = _currency->separator; + if (StrEmpty(separator)) separator = _currency->separator.c_str(); if (StrEmpty(separator)) separator = _langpack.langpack->digit_group_separator_currency; buff = FormatNumber(buff, number, last, separator); buff = strecpy(buff, multiplier, last); @@ -510,7 +510,7 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, Money n /* Add suffix part, following symbol_pos specification. * Here, it can can be either 1 (suffix) or 2 (both prefix and suffix). * The only remaining value is 1 (prefix), so everything that is not 0 */ - if (spec->symbol_pos != 0) buff = strecpy(buff, spec->suffix, last); + if (spec->symbol_pos != 0) buff = strecpy(buff, spec->suffix.c_str(), last); if (negative) { if (buff + Utf8CharLen(SCC_POP_COLOUR) > last) return buff; |