forked from mirror/OpenTTD
(svn r6108) -NewGRF Feature: Implement currencies replacment via grf file.
All properties can now be modified i.e: Introduction date for euro conversion Currency name, decimal separator, currency symbol (before or after amount) and the rate compared to the base currency, the british pound
This commit is contained in:
16
strings.c
16
strings.c
@@ -381,9 +381,11 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, int64 n
|
||||
number = -number;
|
||||
}
|
||||
|
||||
// add prefix part
|
||||
s = spec->prefix;
|
||||
while (s != spec->prefix + lengthof(spec->prefix) && (c = *s++) != '\0') *buff++ = c;
|
||||
/* add prefix part, only if it is specified by symbol_pos */
|
||||
if (spec->symbol_pos == 0) {
|
||||
s = spec->prefix;
|
||||
while (s != spec->prefix + lengthof(spec->prefix) && (c = *(s++)) != '\0') *(buff)++ = c;
|
||||
}
|
||||
|
||||
// for huge numbers, compact the number into k or M
|
||||
if (compact) {
|
||||
@@ -411,9 +413,11 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, int64 n
|
||||
|
||||
if (compact) *buff++ = compact;
|
||||
|
||||
// add suffix part
|
||||
s = spec->suffix;
|
||||
while (s != spec->suffix + lengthof(spec->suffix) && (c = *s++) != '\0') *buff++ = c;
|
||||
/* add suffix part, only if it is specified by symbol_pos */
|
||||
if (spec->symbol_pos != 0) {
|
||||
s = spec->suffix;
|
||||
while (s != spec->suffix + lengthof(spec->suffix) && (c = *(s++)) != '\0') *(buff++) = c;
|
||||
}
|
||||
|
||||
return buff;
|
||||
}
|
||||
|
Reference in New Issue
Block a user