kaue / jsonexport

{} → :page_facing_up: it's easy to convert JSON to CSV

Home Page:http://kaue.github.io/jsonexport/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

leading zeros

campatsky opened this issue · comments

I have an id field and many of the ids lead with one or more zeros. when i import the csv to excel, these get cut off. normally i would wrap the field in double quotes or a leading single quote to indicate it is a text type. but your nifty exporter handles these special characters differently. how would i make it so my field could retain the leading zeros?

commented

Try using the handle functions, can you share a sample of your json data?

var options = {
    handleNumber: function(number, name){
        return number.toString();
    }
};