[Gambas-user] Possible bug?: Regional formats, float, text and val() function

Rolf-Werner Eilert eilert-sprachen at ...221...
Tue May 14 08:36:50 CEST 2013


And then I just came across this one:

>
> I have a valuebox and a gridview.
>
> I enter a number in the value box (let's say 1/2) and next add it to a
> cell in gridview with a button
>
> When Regional settings are some European mainland country
> Entering 5 1/2 in a valuebox looks like:
> 5,5 (-> with a comma)
> and ends up as 5,5 in gridview (as text)
>
> When I click a row the cell goes into a Float variable
>

So what you do is, you actually store the value in the GUI. The GUI 
converts it to some locale, and you then want to retrieve the value from 
there for further work on it.

If you kept data storing and GUI clearly apart from each other, there 
would be less trouble.

So my proposal is: Keep your data in some array or wherever they come 
from (or poke them into one) which stores them safely in their genuine 
way. Let GUI do its own job; GUI is for display only, and it makes the 
user happy. When you have to evaluate some of the data in the GUI, the 
user's action will point you to them, and you can easily peek the 
genuine data from the data storage (array or whatever) in the background.

Regards
Rolf




More information about the User mailing list