summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/strings.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/strings.cpp b/src/strings.cpp
index 0d27bb9c0..912acfe65 100644
--- a/src/strings.cpp
+++ b/src/strings.cpp
@@ -339,7 +339,9 @@ static char *FormatGenericCurrency(char *buff, const CurrencySpec *spec, Money n
/* for huge numbers, compact the number into k or M */
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;
multiplier = "M";
} else if (number >= 1000000) {