Skip to content

Commit

Permalink
weight_sort: weight is compared numerically (JS)
Browse files Browse the repository at this point in the history
  • Loading branch information
plepe committed Aug 19, 2016
1 parent 5fef07a commit 279863b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weight_sort/weight_sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function weight_sort(arr, weight_key) {
function numerical_cmp(a, b) {
if(a == b)
return 0;
return a < b ? -1 : 1;
return parseFloat(a) < parseFloat(b) ? -1 : 1;
}

var ret1={};
Expand Down

0 comments on commit 279863b

Please sign in to comment.