type detect automatic and set set currency format

type detect automatic and set set currency format

prasanasprasanas Posts: 6Questions: 0Answers: 0
edited September 2013 in General
The subject itself tells you clearly that i get dynamic table(2 coloumn / 3 coloumn / 4 coloumn ) so in that type detect currency like 1,45,000 {indian rupees} and apply currency format sir in the plugin i use i have set the coloumn which is very difficult but i m sure my currency value comes in last coloumn mostly odd come in last before coloumn please help

i dont want this http://datatables.net/plug-ins/sorting#currency static aocoloumn set please help

Replies

  • prasanasprasanas Posts: 6Questions: 0Answers: 0
    got answer

    //table data

    jQuery.fn.dataTableExt.aTypes.unshift(
    function ( sData )
    {
    var sValidChars = "0123456789-,";
    var Char;
    var bDecimal = false;
    /* Check the numeric part */
    for ( i=0 ; i y) ? 1 : 0));
    };

    jQuery.fn.dataTableExt.oSort['numeric-comma-desc'] = function(a,b) {
    var x = (a == "-") ? 0 : a.replace( /,/g, "" );
    var y = (b == "-") ? 0 : b.replace( /,/g, "" );
    x = parseFloat( x );
    y = parseFloat( y );
    return ((x < y) ? 1 : ((x > y) ? -1 : 0));
    };

    $(document).ready(function() {
    oTable = $('#example').dataTable({
    "bJQueryUI": true,
    "bPaginate": false,
    "aaSorting": [[ 1, "desc" ]]
    });
This discussion has been closed.