(parse): Updated the "D" command to take a regular amount, from which

the default flags and precision for its commodity are determined.
This commit is contained in:
John Wiegley 2005-02-18 06:48:00 +00:00
parent d83008166a
commit 30e6111b0f

View file

@ -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, '=')) {