google_currency icon indicating copy to clipboard operation
google_currency copied to clipboard

Incorrect rates for IDR and (other currencies with complex_rate)

Open yinquanteo opened this issue 13 years ago • 1 comments

I get an incorrect exchange rate when converting IDR to USD

require 'money/bank/google_currency'
Money::Bank::GoogleCurrency.new.get_rate(:IDR, :USD).to_s
# => "0.93215105E1"

Literal response from http://www.google.com/ig/calculator?hl=en&q=1IDR%3D%3FUSD {lhs: "1 Indonesian rupiah",rhs: "9.3 \x26#215; 10\x3csup\x3e-5\x3c/sup\x3e U.S. dollars",error: "",icc: true}

The correct rate should be 9.3 x 10e-5.

I see the same problem with other currencies that return complex rates (e.g. VND)

yinquanteo avatar Aug 21 '13 07:08 yinquanteo

I'm working on a fix

yinquanteo avatar Aug 21 '13 07:08 yinquanteo