SpinBox with comas

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
paravisi
Posts: 1
Joined: Sun Dec 19, 2010 10:34 pm

SpinBox with comas

Post by paravisi »

Hello

After my first week using Irrlicht, I discovered a problem with SpinBox.

I was doing picking and showing the position with 3 SpinBoxes. After some time, I tried to press the button Up of one of my SpinBoxes. I realized that the number started to going down.

I saw that the storaged number was 35,3697. When the spinbox was initialized by the first time, all numbers were represented with dots, not commas. As Im at Brazil and we represent floating point numbers with comas, I would ask the Irrlicht community: is Irrlicht acessing data of microsoft windows Globalization namespace?

I wrote a temporary fix re-writting the function "fast_atof_move".


From:

Code: Select all

if (*in == '.')

To:

Code: Select all

if ((*in == '.') || (*in == ','))

Sorry for my bad English
Thx all
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Thanks, it's certainly a valid point. But I'm not sure if changing fast_atof_move is a good idea as it might be used in parsing where comma's might be used as separators in some formats.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yeah, this would require some "global" variables somewhere, which store all the locale settings. But question is if we can change all necessary functions to a more flexible processing, or if we alter strings and numbers to a common base format. I guess you wil have to keep with the current situation for some time. It's not a priority thing.
Post Reply