fix decimals for gravity assets

This commit is contained in:
liangping 2022-04-06 19:43:11 +08:00
parent 7469cd1178
commit a8a3a202eb

View File

@ -390,10 +390,11 @@ export function isTestnet() {
export function formatToken(token, IBCDenom = {}, decimals = 2, withDenom = true) {
if (token) {
const denom = IBCDenom[token.denom] || token.denom
if (withDenom) {
return `${formatTokenAmount(token.amount, decimals, token.denom)} ${formatTokenDenom(IBCDenom[token.denom] || token.denom)}`
return `${formatTokenAmount(token.amount, decimals, denom)} ${formatTokenDenom(denom)}`
}
return formatTokenAmount(token.amount, decimals, token.denom)
return formatTokenAmount(token.amount, decimals, denom)
}
return token
}