Made --european more pervasive in its effect
This commit is contained in:
parent
394c7bd8df
commit
523d4243e8
1 changed files with 8 additions and 4 deletions
|
|
@ -669,7 +669,8 @@ namespace {
|
||||||
|
|
||||||
for (const char * p = buf; *p; p++) {
|
for (const char * p = buf; *p; p++) {
|
||||||
if (*p == '.') {
|
if (*p == '.') {
|
||||||
if (comm && comm->has_flags(COMMODITY_STYLE_EUROPEAN))
|
if (commodity_t::european_by_default ||
|
||||||
|
(comm && comm->has_flags(COMMODITY_STYLE_EUROPEAN)))
|
||||||
out << ',';
|
out << ',';
|
||||||
else
|
else
|
||||||
out << *p;
|
out << *p;
|
||||||
|
|
@ -682,7 +683,8 @@ namespace {
|
||||||
out << *p;
|
out << *p;
|
||||||
|
|
||||||
if (integer_digits > 3 && --integer_digits % 3 == 0) {
|
if (integer_digits > 3 && --integer_digits % 3 == 0) {
|
||||||
if (comm && comm->has_flags(COMMODITY_STYLE_EUROPEAN))
|
if (commodity_t::european_by_default ||
|
||||||
|
(comm && comm->has_flags(COMMODITY_STYLE_EUROPEAN)))
|
||||||
out << '.';
|
out << '.';
|
||||||
else
|
else
|
||||||
out << ',';
|
out << ',';
|
||||||
|
|
@ -977,12 +979,14 @@ bool amount_t::parse(std::istream& in, const parse_flags_t& flags)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (last_comma != string::npos &&
|
else if (last_comma != string::npos &&
|
||||||
commodity().has_flags(COMMODITY_STYLE_EUROPEAN)) {
|
(commodity_t::european_by_default ||
|
||||||
|
commodity().has_flags(COMMODITY_STYLE_EUROPEAN))) {
|
||||||
comm_flags |= COMMODITY_STYLE_EUROPEAN;
|
comm_flags |= COMMODITY_STYLE_EUROPEAN;
|
||||||
quantity->prec = static_cast<precision_t>(quant.length() - last_comma - 1);
|
quantity->prec = static_cast<precision_t>(quant.length() - last_comma - 1);
|
||||||
}
|
}
|
||||||
else if (last_period != string::npos &&
|
else if (last_period != string::npos &&
|
||||||
! (commodity().has_flags(COMMODITY_STYLE_EUROPEAN))) {
|
! (commodity_t::european_by_default ||
|
||||||
|
commodity().has_flags(COMMODITY_STYLE_EUROPEAN))) {
|
||||||
quantity->prec = static_cast<precision_t>(quant.length() - last_period - 1);
|
quantity->prec = static_cast<precision_t>(quant.length() - last_period - 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue