Skip to content

floating point output is wrong in some cultures #21

@AdamMil

Description

@AdamMil

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)
    m_text.append(L".0");

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions