Skip to content

Commit

Permalink
Fix: operation consumed gas
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Jun 15, 2022
1 parent 782845f commit 395062c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/InternalOperation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)}%)`;
}
Expand Down
6 changes: 6 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand Down

0 comments on commit 395062c

Please sign in to comment.