Open Exchange Rates limit to four decimal precision
Closed this issue · 4 comments
pts-owentran commented
In the binding.pry below, expected the exchange to be 0.846563, NOT 0.8466. Don't see a way to pass in precision. Am I missing something?
fx = OpenExchangeRates::Rates.new
=> #<OpenExchangeRates::Rates:0x007fb32c3fea58
@app_id="ed313d98b7a74e6884dd35825ea13eef",
@base="USD",
@latest_parser=#<OpenExchangeRates::Parser:0x007fb32c394d88>,
@latest_response=
{"disclaimer"=>"Usage subject to terms: https://openexchangerates.org/terms",
"license"=>"https://openexchangerates.org/license",
"timestamp"=>1503342000,
"base"=>"USD",
"rates"=>
{"AED"=>3.673018,
"AFN"=>68.656,
"ALL"=>112.06,
...
"EUR"=>0.846563,
fx.exchange_rate(:from => "USD", :to => "EUR") # =>0.846563
=> 0.8466
vlado commented
Hi @pts-owentran, this is strange. If I open irb session and try the same I get 0.846563
vlado commented
What version of gem are you using?
pts-owentran commented
Hi @vlado, you're right. I forked the repo and saw the right precision as well. I believe it's an issue of a monkeypatch in our rails lib initializers Closing this out. Thanks so much for the quick reply!