Ensure numerator is positive before checking if the value is < 1.

This commit is contained in:
John Ralls 2016-03-11 15:43:30 -08:00
parent 1ca56c9d0d
commit a406903705

View File

@ -1631,6 +1631,7 @@ new_price(XferDialog *xferData, Timespec ts)
/* We want to store currency rates such that the rate > 1 and commodity
* prices in terms of a currency regardless of value.
*/
value = gnc_numeric_abs(value);
if (gnc_commodity_is_currency(from) && gnc_commodity_is_currency(to))
{
if (value.num < value.denom)