MorphIO icon indicating copy to clipboard operation
MorphIO copied to clipboard

Set locale to ensure dots are recognized as decimal points in SWC files

Open adrien-berchet opened this issue 1 year ago • 5 comments

In some cases, the function sscanf does not recognize dots as decimal points because of the locale settings of the user (french in my case, so sscanf expects commas as decimal points). This PR ensures that dots are always considered as decimal points in SWC files, regardless of user locale settings.

adrien-berchet avatar Apr 13 '23 08:04 adrien-berchet

I'll look at this; I've wanted to remove the sscanf for a while; but I'm not super happy about how iostreams handle locales, either. Plus, I think it was slower.

mgeplf avatar Apr 13 '23 09:04 mgeplf

Ah ok. As you prefer, this is just a quick fix but we could think about something better.

adrien-berchet avatar Apr 13 '23 09:04 adrien-berchet

Is #460 supposed to replace this PR @mgeplf ?

adrien-berchet avatar Jul 04 '23 13:07 adrien-berchet

Yeah, that's the plan.

mgeplf avatar Jul 04 '23 13:07 mgeplf

Yeah, that's the plan.

Ok!

adrien-berchet avatar Jul 04 '23 14:07 adrien-berchet