seto77 / ReciPro

The software ReciPro makes various crystallographic calculations, visualizes a crystal structure, simulates a diffraction pattern and high-resolution TEM image, indexes diffraction spots, plots stereographic projection, and so on.
https://seto77.github.io/ReciPro/
Other
117 stars 13 forks source link

Issue adding new structures from the database #10

Open jacobjma opened 2 years ago

jacobjma commented 2 years ago

Thank you, I really like this program.

I have an issue when adding new structures from the crystal database.

For example, when I add Mn3Si with a lattice constant of 5.722 Å, the cell volume is given as 1873456270480000 Å^3. It seems that it is not correctly interpreting the decimal separator since 5722^3 = 1873456270480000.

I suspect the issue is due to using a danish language operating system where the "," (comma) is used as a decimal separator.

I would suggest always using the "." (dot) separator. I think most scientists prefer the dot separator, despite the convention of their respective countries.

I am also not able to open Structure Viewer for newly added structures, however, I think this is directly related to the above issue.

System: Windows 11 .Net 6.0 ReciPro ver4.826(2021/11/18)

seto77 commented 2 years ago

Thank you very much for reporting the bug.

As you pointed out, the cause of this problem seems to be that the symbols for the decimal point separator and the 3-digit separator are different in different cultures (which is defined by OS setting).

Since the conversion from strings to numbers is done in various places in the program, it will take some time to fix everything. In the new version (ver4.827), I have improved the behaviour when importing crystal structures from the database. Please give it a try.

jacobjma commented 2 years ago

Thank you. I can confirm that ver4.827 fixes the issue.

I have not encountered the issue anywhere else.