diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-14 17:14:56 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-14 17:14:56 -0400 |
commit | f3bedb88b24ae8b2047ad86e57b161265c2812f5 (patch) | |
tree | e6e5954f40a09e7fd002f242523c1eb0f318b397 /src/commodity.cc | |
parent | 0c699e4d57fe91fa04c4c2f23f9c2f2a6a5da582 (diff) | |
parent | 63b4bdaecff5a865bff22e8e7914bef6ab46fa6b (diff) | |
download | fork-ledger-f3bedb88b24ae8b2047ad86e57b161265c2812f5.tar.gz fork-ledger-f3bedb88b24ae8b2047ad86e57b161265c2812f5.tar.bz2 fork-ledger-f3bedb88b24ae8b2047ad86e57b161265c2812f5.zip |
Merge branch 'next'
Diffstat (limited to 'src/commodity.cc')
-rw-r--r-- | src/commodity.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/commodity.cc b/src/commodity.cc index 230113e8..179bbc05 100644 --- a/src/commodity.cc +++ b/src/commodity.cc @@ -646,9 +646,13 @@ void commodity_t::print(std::ostream& out, bool elide_quotes) const { string sym = symbol(); if (elide_quotes && has_flags(COMMODITY_STYLE_SEPARATED) && - ! sym.empty() && sym[0] == '"' && ! std::strchr(sym.c_str(), ' ')) { - DEBUG("foo", "contracting " << sym << " to " << string(sym, 1, sym.length() - 2)); - out << string(sym, 1, sym.length() - 2); + ! sym.empty() && sym[0] == '"' && + ! std::strchr(sym.c_str(), ' ')) { + string subsym(sym, 1, sym.length() - 2); + if (! all(subsym, is_digit())) + out << subsym; + else + out << sym; } else out << sym; } |