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

floating point output is wrong in some cultures #21

AdamMil opened this Issue Jan 22, 2019 · 0 comments


None yet
1 participant
Copy link

AdamMil commented Jan 22, 2019

NutCracker uses the .OCP culture, which prints numbers according to the user's locale. So in countries that use the comma as the decimal separator rather than the period, a number like 1.25 gets printed as 1,250000. Then, NutCracker tries to find a period in it:

if (m_text.indexOf('.') == std::string::npos)

Since it doesn't find one, it adds ".0" to the end, resulting in "1,250000.0", which is not a valid Squirrel number.

NutCracker should use a fixed culture that always uses the period as the decimal separator.

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