zemirco / json2csv

Convert json to csv with column titles
http://zemirco.github.io/json2csv
MIT License
2.71k stars 366 forks source link

New option to format numbers using locale settings #555

Closed sbarzaghialteaup closed 2 years ago

sbarzaghialteaup commented 2 years ago

With this option we can open a csv file with Excel and directly do calculation on numeric fields, without this option Excel on windows with Italy locales interprets the numeric fields like 1200.00 as string.

sbarzaghialteaup commented 2 years ago

Tests are using the delimiter ";" because the default delimiter is "," but this character is the decimals separator in Italian number formatting

juanjoDiaz commented 2 years ago

I thought that I commented on this already. It seems like I didn't. I don't think that we should merge this into v5.

v6 already include the concept of formatters which is a lot richer than this. v5 should stay in maintenance mode and not add new features.

knownasilya commented 2 years ago

I didn't notice that this was for v5. I agree! For v6 I'd like to see it maybe in the docs as an example of a formatter with this use-case as the example. In the future we might want to package common formatters.

sbarzaghialteaup commented 2 years ago

I agree too! I can use my fork ;-)

v6 release is already scheduled? seems in alpha up to now

knownasilya commented 2 years ago

Releasing a beta this week.

juanjoDiaz commented 2 years ago

Documentation is already there: https://github.com/zemirco/json2csv#number

We could, of course, add an example to the examples document.