fix price in usd

This commit is contained in:
c9s 2022-05-04 17:45:28 +08:00
parent 4404098bf9
commit 08a1819bd3
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -123,12 +123,12 @@ func (m BalanceMap) Assets(prices map[string]fixedpoint.Value, priceTime time.Ti
if !asset.Total.IsZero() {
asset.InUSD = asset.Total.Div(usdPrice)
}
asset.PriceInUSD = usdPrice
asset.PriceInUSD = fixedpoint.One.Div(usdPrice)
} else {
if !asset.Total.IsZero() {
asset.InUSD = asset.Total.Mul(usdPrice)
}
asset.PriceInUSD = fixedpoint.One.Div(usdPrice)
asset.PriceInUSD = usdPrice
}
if hasBtcPrice && !asset.InUSD.IsZero() {