forked from LaconicNetwork/cosmos-explorer
Fix inflation for evmos
This commit is contained in:
+24
-8
@@ -224,16 +224,32 @@ export default {
|
||||
if (typeof data[k] === 'boolean') {
|
||||
return { title: data[k], subtitle: k }
|
||||
}
|
||||
const d = Number(data[k])
|
||||
if (d < 1.01) {
|
||||
return { title: `${percent(d)}%`, subtitle: k }
|
||||
}
|
||||
if (d > 1000000000) {
|
||||
return { title: `${toDuration(d / 1000000)}`, subtitle: k }
|
||||
}
|
||||
return { title: data[k], subtitle: k }
|
||||
return { title: this.convert(data[k]), subtitle: k }
|
||||
})
|
||||
},
|
||||
convert(v) {
|
||||
if (typeof v === 'object') {
|
||||
const v2 = {}
|
||||
Object.entries(v).forEach(e => {
|
||||
const k = e[0]
|
||||
const x = e[1]
|
||||
v2[k] = this.convert(x)
|
||||
})
|
||||
return v2
|
||||
}
|
||||
const d = parseFloat(v)
|
||||
if (d === 0) return 0
|
||||
if (d < 1.01) {
|
||||
return `${percent(d)}%`
|
||||
}
|
||||
if (d > 1000000000) {
|
||||
return `${toDuration(d / 1000000)}`
|
||||
}
|
||||
if (d > 0) {
|
||||
return d.toFixed()
|
||||
}
|
||||
return v
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user