 
             # if requested make sure unused columns are in alphabetical order
             if opts.autoSortUnusedAttrs
+                natSort = $.pivotUtilities.naturalSort
                 unusedAttrsContainer = $("td#unused.pvtAxisContainer")
-                $(unusedAttrsContainer).children("li").sort((a, b) ->
-                    (if $(a).text().toLowerCase() > $(b).text().toLowerCase() then 1 else -1)
-                ).appendTo unusedAttrsContainer    
-                
+                $(unusedAttrsContainer).children("li")
+                    .sort((a, b) => natSort($(a).text(), $(b).text()))
+                    .appendTo unusedAttrsContainer
+
         #the very first refresh will actually display the table
         refresh()
 

        @colTotals = {}
        @allTotal = @aggregator(this, [], [])
        @sorted = false
    
    natSort: (as, bs) => #from http://stackoverflow.com/a/4373421/112871
      rx = /(\d+)|(\D+)/g
      rd = /\d/
      rz = /^0/
      if typeof as is "number" or typeof bs is "number"
        return 1  if isNaN(as)
        return -1  if isNaN(bs)
        return as - bs
      a = String(as).toLowerCase()
      b = String(bs).toLowerCase()
      return 0  if a is b
      return (if a > b then 1 else -1)  unless rd.test(a) and rd.test(b)
      a = a.match(rx)
      b = b.match(rx)
      while a.length and b.length
        a1 = a.shift()
        b1 = b.shift()
        if a1 isnt b1
          if rd.test(a1) and rd.test(b1)
            return a1.replace(rz, ".0") - b1.replace(rz, ".0")
          else
            return (if a1 > b1 then 1 else -1)
      a.length - b.length

    arrSort: (a,b) => @natSort a.join(), b.join()


        #thanks http://stackoverflow.com/a/12213072/112871
        (record) ->
            date = new Date(Date.parse(record[col]))
            formatString.replace /%(.)/g, (m, p) ->
                switch p
                    when "y" then date.getFullYear()
                    when "m" then zeroPad(date.getMonth()+1)
