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.
This commit is contained in:
Mike Alexander 2019-01-27 23:44:36 -05:00
parent df19244792
commit 5bd7875437
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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;