Last active
August 17, 2017 03:11
-
-
Save bernatfortet/3f191befb9caf093cf83dbdc0e488df3 to your computer and use it in GitHub Desktop.
Reorganize coinMarketCap Top20 by volume and negative change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){ | |
tbody = $('#currencies_wrapper').find('tbody'); | |
tbody.children() | |
.each( function(index, item){ | |
if( index >= 20 ) | |
item.remove(); | |
}); | |
tbody.find('tr') | |
.sort( function( itemA, itemB ){ | |
percentItemA = parseFloat( $(itemA).find('.percent-24h').text() ); | |
percentItemB = parseFloat( $(itemB).find('.percent-24h').text() ); | |
if( percentItemA > percentItemB ) | |
return 1; | |
else | |
return -1; | |
}) | |
.appendTo(tbody); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment