From 02168c782364a1a8641b4bed7ebf4a84cb6b3560 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 22 Aug 2004 02:40:18 -0400 Subject: escape codes in format strings; can now redefine individual report formats --- textual.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'textual.cc') 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; } -- cgit v1.2.3