Skip to content

Commit

Permalink
Use Valve's GetPriceValueAsInt when sorting by price
Browse files Browse the repository at this point in the history
  • Loading branch information
xPaw committed Jul 14, 2024
1 parent 84d8fe4 commit fcb9d44
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions code.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3101,14 +3101,12 @@
sortFunction: function(a, b) {
var listingPriceA = $(a.values().market_listing_price).text();
listingPriceA = listingPriceA.substr(0, listingPriceA.indexOf('('));
listingPriceA = listingPriceA.replace('--', '00');

var listingPriceB = $(b.values().market_listing_price).text();
listingPriceB = listingPriceB.substr(0, listingPriceB.indexOf('('));
listingPriceB = listingPriceB.replace('--', '00');

var firstPrice = parseInt(replaceNonNumbers(listingPriceA));
var secondPrice = parseInt(replaceNonNumbers(listingPriceB));
var firstPrice = unsafeWindow.GetPriceValueAsInt(listingPriceA);
var secondPrice = unsafeWindow.GetPriceValueAsInt(listingPriceB);

return firstPrice - secondPrice;
}
Expand Down

0 comments on commit fcb9d44

Please sign in to comment.