summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
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;
}