format total value

This commit is contained in:
liangping 2023-06-12 10:33:47 +08:00
parent 8f9e490124
commit 8ec5a9822a

View File

@ -67,7 +67,22 @@ const totalAmount = computed(() => {
});
const totalValue = computed(() => {
return 0;
let value = 0;
delegations.value?.forEach((x) => {
value += format.tokenValueNumber(x.balance);
});
rewards.value?.total?.forEach((x) => {
value += format.tokenValueNumber(x);
});
balances.value?.forEach((x) => {
value += format.tokenValueNumber(x);
});
unbonding.value?.forEach((x) => {
x.entries?.forEach((y) => {
value += format.tokenValueNumber({amount: y.balance, denom: stakingStore.params.bond_denom});
});
});
return format.formatNumber(value, '0,0.00');
});