diff options
author | John Wiegley <johnw@newartisans.com> | 2004-08-22 02:40:18 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-08-22 02:40:18 -0400 |
commit | 02168c782364a1a8641b4bed7ebf4a84cb6b3560 (patch) | |
tree | f3e31f99245871413587d3eb0ad1fa5974bf9558 /textual.cc | |
parent | 5619a1d5be144877df8cce01c40ff668bbb0c96a (diff) | |
download | fork-ledger-02168c782364a1a8641b4bed7ebf4a84cb6b3560.tar.gz fork-ledger-02168c782364a1a8641b4bed7ebf4a84cb6b3560.tar.bz2 fork-ledger-02168c782364a1a8641b4bed7ebf4a84cb6b3560.zip |
escape codes in format strings; can now redefine individual report formats
Diffstat (limited to 'textual.cc')
-rw-r--r-- | textual.cc | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -71,14 +71,19 @@ transaction_t * parse_transaction_text(char * line, account_t * account, } char * price_str = std::strchr(cost_str, '@'); + bool per_unit = true; if (price_str) { *price_str++ = '\0'; + if (*price_str == '@') { + per_unit = false; + price_str++; + } xact->cost = new amount_t; xact->cost->parse(price_str); } xact->amount.parse(cost_str); - if (price_str) + if (price_str && per_unit) *xact->cost *= xact->amount; } |