Corrected the way that thousands markers are output.
This commit is contained in:
parent
1ece3f8b1c
commit
90404e85fa
1 changed files with 10 additions and 6 deletions
|
|
@ -580,7 +580,7 @@ namespace {
|
||||||
for (const char * p = buf; *p; p++) {
|
for (const char * p = buf; *p; p++) {
|
||||||
if (*p == '.')
|
if (*p == '.')
|
||||||
break;
|
break;
|
||||||
else if (std::isdigit(*p))
|
else if (*p != '-')
|
||||||
integer_digits++;
|
integer_digits++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -591,16 +591,20 @@ namespace {
|
||||||
out << ',';
|
out << ',';
|
||||||
else
|
else
|
||||||
out << *p;
|
out << *p;
|
||||||
assert(integer_digits < 3);
|
assert(integer_digits <= 3);
|
||||||
} else {
|
}
|
||||||
if (integer_digits >= 3 && std::isdigit(*p) &&
|
else if (*p == '-') {
|
||||||
integer_digits-- % 3 == 0) {
|
out << *p;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
out << *p;
|
||||||
|
|
||||||
|
if (integer_digits > 3 && --integer_digits % 3 == 0) {
|
||||||
if (comm && comm->has_flags(COMMODITY_STYLE_EUROPEAN))
|
if (comm && comm->has_flags(COMMODITY_STYLE_EUROPEAN))
|
||||||
out << '.';
|
out << '.';
|
||||||
else
|
else
|
||||||
out << ',';
|
out << ',';
|
||||||
}
|
}
|
||||||
out << *p;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue