NumberFormatting is not working

NumberFormatting is not working

Saritha Saritha Posts: 23Questions: 7Answers: 1

I have tried a lot with number formatting using the below logic but it is not working.
Its kind of urjency and let me know how can i achieve the number formatting with comma

j$ = jQuery.noConflict(); j$(document).ready( function () { j$('[id$="aragingtable"]').DataTable({ "language": { "decimal": "-", "thousands": "." } }); });

This question has an accepted answers - jump to answer

Answers

  • Saritha Saritha Posts: 23Questions: 7Answers: 1
    Answer ✓

    I did like ths and working fine

    j$ = jQuery.noConflict(); j$(document).ready( function () { j$('[id$="aragingtable"]').DataTable({ "aoColumnDefs": [ { "aTargets": [ 5,6 ], "mRender": function (data, type, full) { var formmatedvalue=data.replace(/(\d+)(\d{3})/, '$1' + ',' + '$2') return formmatedvalue; } }] }); });

    ==============
    But I am adding the Ordering also in this "order": [ 4, 'desc' ] in this case it is not working.

    j$ = jQuery.noConflict(); j$(document).ready( function () { j$('[id$="aragingtable"]').DataTable({ "order": [ 4, 'desc' ] "aoColumnDefs": [ { "aTargets": [ 5,6 ], "mRender": function (data, type, full) { var formmatedvalue=data.replace(/(\d+)(\d{3})/, '$1' + ',' + '$2') return formmatedvalue; } }] }); });
  • allanallan Posts: 62,241Questions: 1Answers: 10,211 Site admin

    Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.

    Information on how to create a test page, if you can't provide a link to your own page can be found here.

    Thanks,
    Allan

This discussion has been closed.