Solo restar decimales cuando hay suficientes digitos
All checks were successful
continuous-integration/woodpecker the build was successful

This commit is contained in:
Cat /dev/Nulo 2021-11-12 12:33:34 -03:00
parent 05c2a102d4
commit 4ab9045d8a

View file

@ -76,7 +76,7 @@ func GetAssets() (Assets, error) {
}
trimmed := a.LastSale.TotalPrice
decimals := a.LastSale.PaymentToken.Decimals
if a.LastSale.PaymentToken.Decimals > 16 {
if a.LastSale.PaymentToken.Decimals > 16 && len(trimmed) > 16 {
trimmed = trimmed[:len(trimmed)-16]
decimals = decimals - 16
}