How to format number (with points in values of one thousand (1,000) to a jquery datatable

2

I can not order a numeric column, I'm ordered but the points are taken as decimals and I need the format to be the opposite.

Thanks for the help!

    
asked by Luis Alberto Aguilera Clarke 27.10.2016 в 16:19
source

2 answers

4

You have to add the type of the column when you define the DataTable. You can do this using the type attribute as explained in the documentation .

Without seeing your code, I can not tell you how you would do it, but here is the example of the DataTables page:

$(document).ready(function() {
    $('#example').dataTable( {
        "columnDefs": [
            { "type": "numeric-comma", targets: 3 }
        ]
    } );
} );
    
answered by 27.10.2016 в 16:47
1

Or you could use http://numeraljs.com/ to give the desired format and pull the data as you want to order.

    
answered by 31.10.2016 в 09:51