Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #339 from LiskHQ/326-conform-all-numbers-with-comma
Browse files Browse the repository at this point in the history
Conform all numbers with comma - Closes #326
  • Loading branch information
yasharAyari authored Jun 12, 2017
2 parents 910973d + 56e5819 commit 752dcf4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/forging/forging.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
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')
Expand Down
2 changes: 1 addition & 1 deletion src/components/lsk/lsk.pug
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
span(ng-bind='$ctrl.amount | lsk')
span(ng-bind='$ctrl.amount | lsk | liskNumber')
span(ng-show='$ctrl.append')= ' LSK'
15 changes: 15 additions & 0 deletions src/filters/liskNumber.js
Original file line number Diff line number Diff line change
@@ -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]}`;
};
});
1 change: 1 addition & 0 deletions src/liskNano.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import './services/sync';
import './services/notification';

import './filters/lsk';
import './filters/liskNumber';

import './run';
import './states';

0 comments on commit 752dcf4

Please sign in to comment.