Don't elide quotes for all-digit commodities
This commit is contained in:
parent
dcffd218a1
commit
c2a77c1237
1 changed files with 7 additions and 3 deletions
|
|
@ -646,9 +646,13 @@ void commodity_t::print(std::ostream& out, bool elide_quotes) const
|
||||||
{
|
{
|
||||||
string sym = symbol();
|
string sym = symbol();
|
||||||
if (elide_quotes && has_flags(COMMODITY_STYLE_SEPARATED) &&
|
if (elide_quotes && has_flags(COMMODITY_STYLE_SEPARATED) &&
|
||||||
! sym.empty() && sym[0] == '"' && ! std::strchr(sym.c_str(), ' ')) {
|
! sym.empty() && sym[0] == '"' &&
|
||||||
DEBUG("foo", "contracting " << sym << " to " << string(sym, 1, sym.length() - 2));
|
! std::strchr(sym.c_str(), ' ')) {
|
||||||
out << string(sym, 1, sym.length() - 2);
|
string subsym(sym, 1, sym.length() - 2);
|
||||||
|
if (! all(subsym, is_digit()))
|
||||||
|
out << subsym;
|
||||||
|
else
|
||||||
|
out << sym;
|
||||||
} else
|
} else
|
||||||
out << sym;
|
out << sym;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue