optimize token format
This commit is contained in:
parent
22123af7c8
commit
aa2ceae79c
@ -304,7 +304,7 @@ export function formatTokenAmount(tokenAmount, fraction = 2, denom = 'uatom') {
|
|||||||
return parseFloat(amount)
|
return parseFloat(amount)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function formatToken(token, IBCDenom = {}, decimals = 0) {
|
export function formatToken(token, IBCDenom = {}, decimals = 2) {
|
||||||
if (token) {
|
if (token) {
|
||||||
return `${formatTokenAmount(token.amount, decimals, token.denom)} ${formatTokenDenom(IBCDenom[token.denom] || token.denom)}`
|
return `${formatTokenAmount(token.amount, decimals, token.denom)} ${formatTokenDenom(IBCDenom[token.denom] || token.denom)}`
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
percent,
|
percent,
|
||||||
tokenFormatter(amount, denom) {
|
tokenFormatter(amount, denom) {
|
||||||
return formatToken({ amount, denom })
|
return formatToken({ amount, denom }, {}, 0)
|
||||||
},
|
},
|
||||||
rankBadge(data) {
|
rankBadge(data) {
|
||||||
const { index, item } = data
|
const { index, item } = data
|
||||||
|
Loading…
Reference in New Issue
Block a user