forked from cerc-io/cosmos-explorer
fix decimals for gravity assets
This commit is contained in:
parent
7469cd1178
commit
a8a3a202eb
@ -390,10 +390,11 @@ export function isTestnet() {
|
|||||||
|
|
||||||
export function formatToken(token, IBCDenom = {}, decimals = 2, withDenom = true) {
|
export function formatToken(token, IBCDenom = {}, decimals = 2, withDenom = true) {
|
||||||
if (token) {
|
if (token) {
|
||||||
|
const denom = IBCDenom[token.denom] || token.denom
|
||||||
if (withDenom) {
|
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
|
return token
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user