Prevent long number from being displayed in Scientific Notation

Prevent long number from being displayed in Scientific Notation

love_salesforcelove_salesforce Posts: 2Questions: 0Answers: 0
edited November 2013 in General
I am using JQuery datatables.net to show data in my VF page.

But , a number e.g -> 778002405501 is showing like this -> 7.78002E+11

How to prevent this and show it properly? Any idea

Replies

  • love_salesforcelove_salesforce Posts: 2Questions: 0Answers: 0
    This worked:
    [code]
    for (i = 0; i < records.length; i++) {
    for (j in records[i]) {
    cellValue = records[i][j];
    if (cellValue) {
    if(!isNaN(cellValue)){
    records[i][j] = Number(cellValue).toPrecision();
    }
    }
    }
    }


    [/code]

    Then pass records in datatable like this : "aaData": records
This discussion has been closed.