Skip to content

Commit bcbd046

Browse files
committed
Ensure base 10 for numeric sort
1 parent f277838 commit bcbd046

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

coffee/sortable.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ sortable =
8383
numeric:
8484
defaultSortDirection: 'descending'
8585
compare: (a, b) ->
86-
aa = parseFloat(a[0].replace(/[^0-9.-]/g, ''))
87-
bb = parseFloat(b[0].replace(/[^0-9.-]/g, ''))
86+
aa = parseFloat(a[0].replace(/[^0-9.-]/g, ''), 10)
87+
bb = parseFloat(b[0].replace(/[^0-9.-]/g, ''), 10)
8888
aa = 0 if isNaN(aa)
8989
bb = 0 if isNaN(bb)
9090
bb - aa

js/sortable.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)