Implement the filter on page.html


#1

Hi all how do I fillter curreny to like this on ionic page.html?

Thanks,


#2

Solved:

.filter( ‘shortNumber’, function() {
return function( number ) {
if ( number ) {
abs = Math.abs( number );
if ( abs >= Math.pow( 10, 12 ) ) {
// trillion
number = ( number / Math.pow( 10, 12 ) ).toFixed( 1 ) + “T”;
} else if ( abs < Math.pow( 10, 12 ) && abs >= Math.pow( 10, 9 ) ) {
// billion
number = ( number / Math.pow( 10, 9 ) ).toFixed( 1 ) + “M”;
} else if ( abs < Math.pow( 10, 9 ) && abs >= Math.pow( 10, 6 ) ) {
// million
number = ( number / Math.pow( 10, 6 ) ).toFixed( 1 ) + “Jt”;
} else if ( abs < Math.pow( 10, 6 ) && abs >= Math.pow( 10, 3 ) ) {
// thousand
number = ( number / Math.pow( 10, 3 ) ).toFixed( 1 ) + “Rb”;
}
return number;
}
};
})