From 94cf268d5a5aba2521d73da24e5872ab58b2a0a2 Mon Sep 17 00:00:00 2001 From: yashar Date: Wed, 7 Jun 2017 19:50:19 +0430 Subject: [PATCH 1/6] Add Number filter to lisk component and forging component --- src/components/forging/forging.pug | 2 +- src/components/lsk/lsk.pug | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/forging/forging.pug b/src/components/forging/forging.pug index b3a138e0d..2a871cde8 100644 --- a/src/components/forging/forging.pug +++ b/src/components/forging/forging.pug @@ -73,7 +73,7 @@ md-card.offline-hide th(md-column) Reward tbody(md-body, infinite-scroll='$ctrl.loadMoreBlocks()', infinite-scroll-distance='1') tr(md-row, ng-repeat='block in $ctrl.blocks') - td(md-cell data-title='tableBlocks.cols.height', sortable="'height'") {{block.height}} + td(md-cell data-title='tableBlocks.cols.height', sortable="'height'") {{block.height | number:2}} td(md-cell data-title='tableBlocks.cols.blockId', ng-show='$ctrl.showAllColumns') {{block.id}} td(md-cell data-title='tableBlocks.cols.timestamp', sortable="'timestamp'") span(ng-show='block.timestamp > 0') diff --git a/src/components/lsk/lsk.pug b/src/components/lsk/lsk.pug index 3f47e971b..15ebd9aa8 100644 --- a/src/components/lsk/lsk.pug +++ b/src/components/lsk/lsk.pug @@ -1,2 +1,2 @@ -span(ng-bind='$ctrl.amount | lsk') +span(ng-bind='$ctrl.amount | lsk | number:2') span(ng-show='$ctrl.append')= ' LSK' From 74dfbea731d77611e5ea4f81ec8657812a5fe713 Mon Sep 17 00:00:00 2001 From: yashar Date: Fri, 9 Jun 2017 14:23:50 +0430 Subject: [PATCH 2/6] Increase numbers can be shown after floating point to 8 numbers --- src/components/lsk/lsk.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/lsk/lsk.pug b/src/components/lsk/lsk.pug index 15ebd9aa8..30e3075ce 100644 --- a/src/components/lsk/lsk.pug +++ b/src/components/lsk/lsk.pug @@ -1,2 +1,2 @@ -span(ng-bind='$ctrl.amount | lsk | number:2') +span(ng-bind='$ctrl.amount | lsk | number:8') span(ng-show='$ctrl.append')= ' LSK' From 4fc35d644424ca21f99b5d72784ad4f47280e02d Mon Sep 17 00:00:00 2001 From: yashar Date: Fri, 9 Jun 2017 14:38:25 +0430 Subject: [PATCH 3/6] Increase numbers can be shown after floating point to 8 numbers in forging companent --- src/components/forging/forging.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/forging/forging.pug b/src/components/forging/forging.pug index 07be2b338..3d7734c69 100644 --- a/src/components/forging/forging.pug +++ b/src/components/forging/forging.pug @@ -67,7 +67,7 @@ md-card.offline-hide th(md-column) Reward tbody(md-body, infinite-scroll='$ctrl.loadMoreBlocks()', infinite-scroll-distance='1') tr(md-row, ng-repeat='block in $ctrl.blocks') - td(md-cell data-title='tableBlocks.cols.height', sortable="'height'") {{block.height | number:2}} + td(md-cell data-title='tableBlocks.cols.height', sortable="'height'") {{block.height | number:8}} td(md-cell data-title='tableBlocks.cols.blockId', ng-show='$ctrl.showAllColumns') {{block.id}} td(md-cell data-title='tableBlocks.cols.timestamp', sortable="'timestamp'") span(ng-show='block.timestamp > 0') From b52759199c28f9f7d632131159148fd53b6638ee Mon Sep 17 00:00:00 2001 From: yashar Date: Fri, 9 Jun 2017 18:24:23 +0430 Subject: [PATCH 4/6] Create liskNumber filter to conform all numbers with comma --- src/filters/liskNumber.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/filters/liskNumber.js diff --git a/src/filters/liskNumber.js b/src/filters/liskNumber.js new file mode 100644 index 000000000..a9c0e325f --- /dev/null +++ b/src/filters/liskNumber.js @@ -0,0 +1,15 @@ +/** + * This filter format numbers and add comma sperator to them + * + * @module app + */ +app.filter('liskNumber', ($filter) => { + const numberFilter = $filter('number'); + return (input) => { + const temp = input.toString().split('.'); + if (temp.length === 1) { + return numberFilter(temp[0]); + } + return `${numberFilter(temp[0])}.${temp[1]}`; + }; +}); From 253a37bfebc9c44275ff7264908094fc443d21c3 Mon Sep 17 00:00:00 2001 From: yashar Date: Fri, 9 Jun 2017 18:26:16 +0430 Subject: [PATCH 5/6] Use liskNumber in lsk component and forging component --- src/components/forging/forging.pug | 2 +- src/components/lsk/lsk.pug | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/forging/forging.pug b/src/components/forging/forging.pug index 3d7734c69..896b8606e 100644 --- a/src/components/forging/forging.pug +++ b/src/components/forging/forging.pug @@ -67,7 +67,7 @@ md-card.offline-hide th(md-column) Reward tbody(md-body, infinite-scroll='$ctrl.loadMoreBlocks()', infinite-scroll-distance='1') tr(md-row, ng-repeat='block in $ctrl.blocks') - td(md-cell data-title='tableBlocks.cols.height', sortable="'height'") {{block.height | number:8}} + td(md-cell data-title='tableBlocks.cols.height', sortable="'height'") {{block.height | liskNumber}} td(md-cell data-title='tableBlocks.cols.blockId', ng-show='$ctrl.showAllColumns') {{block.id}} td(md-cell data-title='tableBlocks.cols.timestamp', sortable="'timestamp'") span(ng-show='block.timestamp > 0') diff --git a/src/components/lsk/lsk.pug b/src/components/lsk/lsk.pug index 30e3075ce..0a1658113 100644 --- a/src/components/lsk/lsk.pug +++ b/src/components/lsk/lsk.pug @@ -1,2 +1,2 @@ -span(ng-bind='$ctrl.amount | lsk | number:8') +span(ng-bind='$ctrl.amount | lsk | liskNumber') span(ng-show='$ctrl.append')= ' LSK' From 909ab5a9564f8293ac74d477ef0916504078d170 Mon Sep 17 00:00:00 2001 From: yashar Date: Fri, 9 Jun 2017 18:27:01 +0430 Subject: [PATCH 6/6] Add liskNumber filter to loskNano.js --- src/liskNano.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/liskNano.js b/src/liskNano.js index fe7d8037f..e2391e734 100644 --- a/src/liskNano.js +++ b/src/liskNano.js @@ -35,6 +35,7 @@ import './services/sync'; import './services/notification'; import './filters/lsk'; +import './filters/liskNumber'; import './run'; import './states';