From 5bd787543703c40920dd4e5ae9d8c044a7f8b10d Mon Sep 17 00:00:00 2001 From: Mike Alexander Date: Sun, 27 Jan 2019 23:44:36 -0500 Subject: [PATCH] Revert the part of 923b01e2 which reverses currency quotes less than 1. Now that GnuCash uses 64 bit numbers in numerics this is not necessary. It can store a number as small as 1e-9 with 9 significant digits. --- libgnucash/quotes/gnc-fq-dump | 4 +++- libgnucash/quotes/gnc-fq-helper.in | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libgnucash/quotes/gnc-fq-dump b/libgnucash/quotes/gnc-fq-dump index 44e18266d8..e87e55cc70 100755 --- a/libgnucash/quotes/gnc-fq-dump +++ b/libgnucash/quotes/gnc-fq-dump @@ -168,7 +168,9 @@ if ($exchange eq "currency") { while ($#ARGV >= 0) { my $to = shift; my $result = $q->currency($from, $to); - unless (defined($result) && $result >= 1) { + # Sometimes quotes are available in only one direction. + # If we didn't get the one we wanted try the reverse quote + unless (defined($result)) { my $inv_res = $q->currency($to, $from); if (defined($inv_res)) { my $tmp = $to; diff --git a/libgnucash/quotes/gnc-fq-helper.in b/libgnucash/quotes/gnc-fq-helper.in index fb6e4e9656..1e781913eb 100755 --- a/libgnucash/quotes/gnc-fq-helper.in +++ b/libgnucash/quotes/gnc-fq-helper.in @@ -349,10 +349,8 @@ while(<>) { my $price = $quoter->currency($from_currency, $to_currency); my $inv_price = undef; - #Sometimes price quotes are available in only one direction, and if the - #direction we asked for results in a quote < 1 we want the other direction - #if it's available to get more significant digits. - unless (defined($price) && $price > 1) { + # Sometimes price quotes are available in only one direction. + unless (defined($price)) { $inv_price = $quoter->currency($to_currency, $from_currency); if (defined($inv_price)) { my $tmp = $to_currency;