(svn r6454) -Fix(r6108) : Allow custom currency to display both prefix and suffix

-Codechange : Divide rate of conversion from grf by 1000, to match OTTD internal system
This commit is contained in:
belugas
2006-09-15 02:52:17 +00:00
parent 79971ac119
commit f9ea48bf3d
4 changed files with 24 additions and 10 deletions

View File

@@ -381,8 +381,10 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, int64 n
number = -number;
}
/* add prefix part, only if it is specified by symbol_pos */
if (spec->symbol_pos == 0) {
/* Add prefix part, folowing symbol_pos specification.
* Here, it can can be either 0 (prefix) or 2 (both prefix anf suffix).
* The only remaining value is 1 (suffix), so everything that is not 1 */
if (spec->symbol_pos != 1){
s = spec->prefix;
while (s != spec->prefix + lengthof(spec->prefix) && (c = *(s++)) != '\0') *(buff)++ = c;
}
@@ -413,7 +415,9 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, int64 n
if (compact) *buff++ = compact;
/* add suffix part, only if it is specified by symbol_pos */
/* Add suffix part, folowing symbol_pos specification.
* Here, it can can be either 1 (suffix) or 2 (both prefix anf suffix).
* The only remaining value is 1 (prefix), so everything that is not 0 */
if (spec->symbol_pos != 0) {
s = spec->suffix;
while (s != spec->suffix + lengthof(spec->suffix) && (c = *(s++)) != '\0') *(buff++) = c;