mirror of
https://github.com/glanceapp/glance.git
synced 2024-11-25 09:54:50 +01:00
#236 fixed change rate calc bug
This commit is contained in:
parent
d80f4872dc
commit
5f27218dcb
@ -108,12 +108,13 @@ func FetchMarketsDataFromYahoo(marketRequests []MarketRequest) (Markets, error)
|
||||
if marketRequests[i].Currency != "" {
|
||||
exchangeRate, err := FetchUSDExchangeRate(marketRequests[i].Currency)
|
||||
if err != nil {
|
||||
slog.Error("Failed to fetch USD/EUR exchange rate", "error", err)
|
||||
slog.Error("Failed to fetch USD exchange rate", "error", err)
|
||||
continue
|
||||
}
|
||||
|
||||
if response.Chart.Result[0].Meta.Currency == "USD" {
|
||||
response.Chart.Result[0].Meta.RegularMarketPrice *= exchangeRate
|
||||
previous *= exchangeRate
|
||||
currency = currencyToSymbol[marketRequests[i].Currency]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user