TableTool icon indicating copy to clipboard operation
TableTool copied to clipboard

Default Decimal Formatting Loses Data on Save

Open AdamBrodzinski opened this issue 7 years ago • 2 comments

I ran into an issue with a clients file where simply open it and hit save and the field 24,000 is truncated to 24.

Would setting the decimal format to . by default be more logical for most peoples use cases?

Example:

#original csv exported from excel
date,income
01/01/01,"24,000"

# after opening in TableTool and hitting save
date,income
"01/01/01","24"

AdamBrodzinski avatar Mar 14 '17 02:03 AdamBrodzinski

Thanks for reporting this!

Always using . is a bad idea. TableTool is used world wide, not just in places were . is the decimal separator. , is commonly used as a decimal separator, but usually in conjunction with ; as field separator.

TableTool tries to be smart. It checks the file and uses some heuristics to guess what format the file is in. In this case it guesses wrong. I'll have to check the heuristics and maybe add some more test cases.

It would be awesome if you could provide some more sample data -- I prefer test cases to have as realistic data as possible, instead of minimal examples.

Besides this, I think that TableTool should be to conserve number formatting, whitespace, quotes etc. as long as the cell isn't edited. Then this problem wouldn't have happened in the first place.

jakob avatar Mar 14 '17 09:03 jakob

Thanks for clearing up the decimal separator issue. I didn't realize this format was used so broadly across the world.

Besides this, I think that TableTool should be to conserve number formatting, whitespace, quotes etc. as long as the cell isn't edited. Then this problem wouldn't have happened in the first place.

Agreed, this would make it much safer to use 👍

It would be awesome if you could provide some more sample data -- I prefer test cases to have as realistic data as possible, instead of minimal examples.

Sure i'll clean the file of all PII and post it in a gist as a test case. I think ideally the user of the file shouldn't have included commas but i'm not sure how Excel formats/exports those number.

AdamBrodzinski avatar Mar 14 '17 16:03 AdamBrodzinski