jQuery UI Widgets Forums Grid numberic value format from grid saved differently as data

This topic contains 4 replies, has 3 voices, and was last updated by  Dimitar 9 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author

  • ashwin prabhu
    Participant

    Hi,

    I am extracting the grid data. My grid has numerical values. If i type 5600 as a numerical value to a cell and extract it by using below code.

    var numbers= \$("#jqxgrid").jqxGrid('exportdata', 'csv');

    I did a console.log(numbers); to see what i was getting.

    It shows 5,600 instead of 5600. Is there a way i could eliminate the comma from such data without affecting the commas overall.

    "8.00","5,434,535.00"," 332.00 "," 4"

    in above code, i want to remove commas from 5,434,535.00 and not let the other commas affected.


    ashwin prabhu
    Participant

    Hi,
    If you could also suggest, how to remove decimal points.
    Like for eg, i entered 8 and it gets saved as 8.00

    i would like to save the value as 8 only. Its because if i save these entries and reload this to grid, the grid says improper format and gives error as ‘ Unexpected token ILLEGAL’


    Dimitar
    Participant

    Hi ashwin prabhu,

    In this case, set the type property of your datafields to ‘string’, e.g.:

    var source = {
        localdata: data,
        datatype: "array",
        datafields: [{
            name: 'quantity',
            type: 'string'
        }, {
            name: 'price',
            type: 'string'
        }]
    };

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/


    Ram
    Participant

    Hi Dimitar,

    Recently we have got into this problem where the thousand separator is applied automatically while using the cellsformat: f1 for a float data type column. As suggested, we tried to change the data type to “string” and could see that the thousand separator is not applied. But the filter options are also changed to string operators instead of numeric operators which is obvious.

    Could you please let us know that is there any other way to remove the thousand separator while using the cellsformat for numeric columns.


    Dimitar
    Participant

    Hi Ram,

    Unfortunately, we cannot provide you with any other solution.

    Best Regards,
    Dimitar

    jQWidgets team
    http://www.jqwidgets.com/

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.