fix issues

This commit is contained in:
liangping 2022-03-04 17:56:41 +08:00
parent 86b4ee0eaa
commit 0df70f5701

View File

@ -1,6 +1,7 @@
<template>
<div class="text-center">
<b-card
v-if="calculateTotalChange !== 0"
border-variant="primary"
>
<b-row class="mx-0 d-flex align-items-center">
@ -43,13 +44,13 @@
v-if="calculateTotalChange > 0"
class="my-0 text-success"
>
+{{ calculateTotalChange }} (24h)
+{{ formatTotalChange(calculateTotalChange) }} (24h)
</small>
<small
v-else
class="my-0 text-danger"
>
{{ calculateTotalChange }} (24h)
{{ formatTotalChange(calculateTotalChange) }} (24h)
</small>
<!-- chart -->
<chart-component-doughnut
@ -422,7 +423,7 @@ export default {
total += subtotal
})
}
return numberWithCommas(parseFloat(total.toFixed(2)))
return parseFloat(total.toFixed(2))
},
calculateByDenom() {
const v = Object.values(this.balances)
@ -565,6 +566,9 @@ export default {
const denom = (v.startsWith('ibc') ? this.ibcDenom[v] : v)
return formatTokenDenom(denom)
},
formatTotalChange(v) {
return numberWithCommas(v)
},
formatAmount(v, denom = 'uatom', format = true) {
if (!v) return ''
const denom2 = (denom.startsWith('ibc') ? this.ibcDenom[denom] : denom)