MaskedRetriever / SuperSkein

Open Source 3D Mesh Slicer in Processing: Generates gcode from stl files.
http://www.thingiverse.com/thing:3649
GNU General Public License v3.0
70 stars 11 forks source link

Commas in the number fields #8

Open MaskedRetriever opened 14 years ago

MaskedRetriever commented 14 years ago

/... i have issues with localization - in the GUI i have explicite to replace the "1,00" and "0,00" for scale and rotation with "1.00" and "0.00" or it gives an exception .../ Viktor

Short-term fix thought: force the initial values to 1 and 0 with no decimals. Would need to put in a catch somewhere so this doesn't /always/ happen....

MaskedRetriever commented 14 years ago

Okay, more from the RR builder's blog:

its on XP and Vista home with Java6 - its the local setings with "," or "." as decimal separator ... the program is expecting "1.00" and the OS changes the "1.0" from config.txt into "1,00" in the GUI.

If i replace the "," in the GUI-screen by "." (really slow, 3 seconds for every interaction on a dualcore) its OK ...

Viktor

Okay first, what the HELL kind of OS uses commas for periods, I'll patch it this weekend if nobody else does, and second, where are three-second delays coming from-- anyone got a system that can reproduce this horribleness?

clothbot commented 14 years ago

It's an internationalization thing - whole countries use "," instead of "." as decimal separators. Java should have these sorts of hooks, which Processing should be able to inherit. It's just a matter of figuring out how to do the string-to-number conversion instead of manual string parsing.

MaskedRetriever commented 14 years ago

Wow, wild. The correct place for this then is in the actual number-figuring code, which I can tell to look for commas as well as periods...

VDX commented 14 years ago

... it's not this simple - if you equals commas and periods, then you'll get mismatching with values bigger thosand ... e.g. in German notation "2.320,4" is the same value as "2,320.4" in the states ;-)

So you have to search the right conversion-routine in respect to the local settings of the OS ...

MaskedRetriever commented 14 years ago

For now I think I'll just create a setting in the config.txt file that lets you select between the two notation systems. Indicators for thousands are presently being left unused, and for now at least I don't plan to fix that. (If someone shows me a use case where they are needed or get dumped in anyway I'll look into it though.)