Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastExcel incorrectly handles decimal separator (eg Russian ,) #55

Open
ryan-de-boer opened this issue Aug 25, 2020 · 0 comments
Open
Labels

Comments

@ryan-de-boer
Copy link

When running under a Russian environment with ',' separator, FastExcel creates xlsx files that Excel reports as corrupt and it repairs them. This is caused by FastExcel using the implicit ToString() on double and decimal Value types in Cell.ToXmlString. This writes for example '1,2' to the xml string. Excel only supports an xml string with dot as the decimal separator, eg '1.2'. By forcing the decimal separator to '.' in the current thread prior to using fastExcel.Write, it solves the issue but it is an undesirable workaround. It would be better if FastExcel wrote '.' as the decimal separator without globally changing the separator. The dot is only in the file format, Excel correctly displays ',' in the UI.

Here is how I fixed it:
fix.txt
I uploaded it as txt, since the whitespace was removed from the code fragments from this post making it hard to read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants