mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Teach xaccSplitConvertAmount that 0*x = 0. Avoids looking up non-existant exchange rate.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18508 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
574385f9fd
commit
9b31a03191
@ -1084,8 +1084,13 @@ xaccSplitConvertAmount (const Split *split, Account * account)
|
||||
* compute the conversion rate (based on amount/value), and then multiply
|
||||
* this times the split value.
|
||||
*/
|
||||
convrate = xaccTransGetAccountConvRate(txn, account);
|
||||
value = xaccSplitGetValue (split);
|
||||
|
||||
if (gnc_numeric_zero_p (value)) {
|
||||
return value;
|
||||
}
|
||||
|
||||
convrate = xaccTransGetAccountConvRate(txn, account);
|
||||
return gnc_numeric_mul (value, convrate,
|
||||
gnc_commodity_get_fraction (to_commodity),
|
||||
GNC_RND_ROUND);
|
||||
|
Loading…
Reference in New Issue
Block a user