move decimals

This commit is contained in:
liangping 2023-06-16 11:40:21 +08:00
parent 4d910b1875
commit b06d3aadc3

View File

@ -59,7 +59,7 @@ const tokenValues = computed(() => {
const values = {} as Record<string, number>; const values = {} as Record<string, number>;
Object.values(balances.value).forEach((b) => { Object.values(balances.value).forEach((b) => {
b.forEach((coin) => { b.forEach((coin) => {
const v = format.tokenValueNumber(coin); const v = parseFloat(format.tokenValueNumber(coin).toFixed(2));
if (v) { if (v) {
if (values[coin.denom]) { if (values[coin.denom]) {
values[coin.denom] += v; values[coin.denom] += v;
@ -71,7 +71,7 @@ const tokenValues = computed(() => {
}); });
Object.values(delegations.value).forEach((b) => { Object.values(delegations.value).forEach((b) => {
b.forEach((d) => { b.forEach((d) => {
const v = format.tokenValueNumber(d.balance); const v = parseFloat(format.tokenValueNumber(d.balance).toFixed(2));
if (v) { if (v) {
if (values[d.balance.denom]) { if (values[d.balance.denom]) {
values[d.balance.denom] += v; values[d.balance.denom] += v;