summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-22 02:40:18 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-22 02:40:18 -0400
commit02168c782364a1a8641b4bed7ebf4a84cb6b3560 (patch)
treef3e31f99245871413587d3eb0ad1fa5974bf9558 /textual.cc
parent5619a1d5be144877df8cce01c40ff668bbb0c96a (diff)
downloadfork-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.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/textual.cc b/textual.cc
index df45d2ce..fa7f28d0 100644
--- a/textual.cc
+++ b/textual.cc
@@ -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;
}