stevetarver / excel-as-json

npm package that converts excel data to json
MIT License
127 stars 38 forks source link

Apply convertTextToNumber to a single column #42

Open NikhilNanjappa-zz opened 6 years ago

NikhilNanjappa-zz commented 6 years ago

I currently have an excel file which has the following data image

Excel formats of the columns are:

crn (column A) - Number accountNumber (column B) - Text

Expected

What I basically want in the converted JSON is to keep the 'crn' as integer type and 'accountNumber' as string type.

Issue

But after converting this to a JSON file, the 'accountNumber' value in JSON is of type integer (and also rounds up the values ex, 12000000000000111 to 12000000000000112 ). If I use the convertTextToNumber flag in options, then BOTH 'crn' and 'accountNumber' are converted to strings which I don't want either.

Any idea on how to resolve this ?

stevetarver commented 6 years ago

@NikhilNanjappa : sounds like another good feature request - provide per field type hints. Will not implement this in the foreseeable future, but not closing - to track the feature request.