(svn r21009) -Fix: for the compact notation 1.000.000k and 1.000M would be shown depending on the initial (and later rounded) value. Make everything that would round to 1.000.000k be drawn as 1.000M as well.

This commit is contained in:
rubidium 2010-10-22 16:30:09 +00:00
parent 3a1a915c9a
commit 9f256e8785

View File

@ -339,7 +339,9 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, Money n
/* for huge numbers, compact the number into k or M */ /* for huge numbers, compact the number into k or M */
if (compact) { if (compact) {
if (number >= 1000000000) { /* Take care of the 'k' rounding. Having 1 000 000 k
* and 1 000 M is inconsistent, so always use 1 000 M. */
if (number >= 1000000000 - 500) {
number = (number + 500000) / 1000000; number = (number + 500000) / 1000000;
multiplier = "M"; multiplier = "M";
} else if (number >= 1000000) { } else if (number >= 1000000) {