您好我想按如下方式对具有值的列进行排序:
$6.99
$6.49
$10.31
$1.75
$1.02
现在当我进行排序时,它认为6.99美元是最高的,当10.31美元大于6.99美元时。我访问了一些堆栈问题并找到了这个解决方案
"language": {
"decimal": ".",
}
但它不起作用。这个你能帮我吗。谢谢
答案 0 :(得分:1)
使用num-fmt
作为columnDefs
或columns
数组选项中列的类型:
$('#example').dataTable({
"columnDefs": [{
"type": "num-fmt",
"targets": X // X = the index of your currency column
}]
});