wrong number conversion #13

balexandre opened this Issue Oct 5, 2016 · 4 comments


None yet

2 participants

balexandre commented Oct 5, 2016 edited

Why does the number 0205e7 gets converted into 2050000000 ? is there an option to avoid conversions and just output the given "strings" ?


here's some data so you can see how the numbers (as code) are being wrongly converted:

@balexandre balexandre changed the title from wrong number to wrong number conversion Oct 5, 2016

0205e7 is in fact a number 205 x 10^7. It uses the E notation. The conversion is correct according to the spec: http://rfc7159.net/rfc7159#rfc.section.6.

This being said, CSVJSON should not reformat the number but just copy as is. I will fix this.

balexandre commented Oct 6, 2016 edited

to make it correctly and add this as a feature, I would suggest to have a 2nd row where we could express the data types, for example:


and a checkbox where we could specify if we're using that data-type row or not... we could try with simple conversions like string, decimal(<decimal char>), date(<format>), etc...

would make a way to keep the conversion as you have currently (might be what the user wants in some cases, for example, if they want numeric values), but give you and us the ability to specify what output we want

as a simple example, if those were HEX color codes, without the initial #, every conversion would fail, setting it as string data-type, it would simply do return field."";

As a developer, I'm just giving my 5 cents on the subject...

@martindrapeau martindrapeau added a commit that referenced this issue Oct 7, 2016
@martindrapeau Fix for GitHub issue #13. Added option to parse number values or not …
…to retain original number formatting.

Also added more inline help and clarified options.

I added an option to parse, or not, numbers. For example:

Your proposal to let the user specify types is a good one, but fairly complex. If I get more requests of that type, I will consider it.

Thanks for your help and let me know if the solution above works for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment