diff --git a/src/components/InternalOperation.vue b/src/components/InternalOperation.vue index 1c598424..fa26055a 100644 --- a/src/components/InternalOperation.vue +++ b/src/components/InternalOperation.vue @@ -281,10 +281,10 @@ export default { }, consumedGas() { if (this.data && this.data.consumed_gas) { - let s = `${this.data.consumed_gas}`; + let s = this.$options.filters.milligas(this.data.consumed_gas); if (this.gasLimit > 0) { s += ` (${( - (this.data.consumed_gas * 100) / + (this.data.consumed_gas * 100 / 1000) / this.gasLimit ).toFixed(0)}%)`; } diff --git a/src/main.js b/src/main.js index c60c3af5..b8970835 100644 --- a/src/main.js +++ b/src/main.js @@ -82,6 +82,12 @@ Vue.filter('uxtz', function (value) { return `${xtz} \uA729`; }) + +Vue.filter('milligas', function (value) { + let gas = (value / 1000).toLocaleString(undefined, { maximumFractionDigits: 0 }); + return `${gas}`; +}) + Vue.filter('mutez', function (value) { let xtz = (value / 1000000).toLocaleString(undefined, { maximumFractionDigits: 6 }); return `${xtz}`;