Help: Sort number custom type

Help: Sort number custom type

dekaerondekaeron Posts: 2Questions: 0Answers: 0
edited October 2013 in General
Hi guys,
I have a little difficulty with the way I use the Sort functionality since I'm using numbers in the following format: 100.000,12
The usual sort does not sort properly.
Please help I'm pretty neophyte,

I use the following code:
[code]
function cargarTabla(){
$(function () {


$('#tablaPro').dataTable( {
sDom: '<"top"i>rt<"top"flp><"clear">',
sPaginationType: "bootstrap",
bFilter: false,
bSort: true,
bInfo: false,
bPaginate: false,
sScrollY:"500px",
bLengthChange: false,
oLanguage: {
"sSearch": "Buscar:",
"sInfoThousands": "'",
"sNext": "Siguiente",
"sPrevious": "Anterior"
}
});
});

}
[/code]

sorry for my English

Replies

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395
    For one thing, you're defining sInfoThousands as an apostrophe but your data is using a dot.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    sInfoThousands has no impact on the sorting. Sorting is done purely as a decimal number in DataTables 1.9.4-. If you want to use any other format, you need to have a sorting plug-in: http://datatables.net/development/sorting#type_based

    Allan
  • dekaerondekaeron Posts: 2Questions: 0Answers: 0
    Thanks!!!
This discussion has been closed.