diff options
author | John Wiegley <johnw@newartisans.com> | 2005-02-18 06:48:00 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:05 -0400 |
commit | 30e6111b0feca122ae5f2d708d258ceddef91d4b (patch) | |
tree | 267ca79884b143dd0b836494c97fe67c5600c611 /textual.cc | |
parent | d83008166aaa702587861949ab53e37343ad0211 (diff) | |
download | fork-ledger-30e6111b0feca122ae5f2d708d258ceddef91d4b.tar.gz fork-ledger-30e6111b0feca122ae5f2d708d258ceddef91d4b.tar.bz2 fork-ledger-30e6111b0feca122ae5f2d708d258ceddef91d4b.zip |
(parse): Updated the "D" command to take a regular amount, from which
the default flags and precision for its commodity are determined.
Diffstat (limited to 'textual.cc')
-rw-r--r-- | textual.cc | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -129,6 +129,7 @@ transaction_t * parse_transaction(char * line, account_t * account) price_str++; } } + parse_amount(skip_ws(cost_str), xact->amount, AMOUNT_PARSE_NO_REDUCE, *xact); if (price_str) { @@ -402,10 +403,12 @@ unsigned int textual_parser_t::parse(std::istream& in, break; #endif // TIMELOG_SUPPORT - case 'D': // a default commodity for "entry" - commodity_t::default_commodity = - commodity_t::find_commodity(skip_ws(line + 1), true); + case 'D': { // a default commodity for "entry" + amount_t amt; + amt.parse(skip_ws(line + 1)); + commodity_t::default_commodity = &amt.commodity(); break; + } case 'C': // a set of conversions if (char * p = std::strchr(line + 1, '=')) { |