|
From: Mark D. <mar...@zn...> - 2007-05-11 16:42:07
|
Hi,
I am guilty of using
if( Wx::wxVERSION() lt '2.006003') { ... }
in my code.
It started off as a reaction to:
Wx::wxVERSION() < 2.006003
returning true when the wxWidgets version was in fact 2.6.3
This is a problem with floating point numbers, I believe.
One soluition I will start to use with the current implementation, if my question is "is wxWidgets less than 2.6.3", is to do
if( Wx::wxVERSION() < 2.0060025) { ... }
It's ugly but it will work for numeric comparison and should therefore be locale independent.
> I think wx::wxVERSION should always use dot-notation, regardless
> of the locale setting.
That would seem a good idea going forward.
MarK
Johan Vromans wrote:
> The result of Wx::wxVERSION seems to be produced with sprintf %f
> format, and therefore obeys the locale settings.
>
> $ env LANG=en_GB perl -MWx -wle 'print $Wx::wxVERSION'
> 2.006003
> $ env LANG=nl_NL perl -MWx -wle 'print $Wx::wxVERSION'
> 2,006003
>
> This gives funny problems when modules use code like:
>
> if( Wx::wxVERSION() lt '2.006003') { ... }
>
> I think wx::wxVERSION should always use dot-notation, regardless
> of the locale setting.
>
> -- Johan
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> wxperl-users mailing list
> wxp...@li...
> https://lists.sourceforge.net/lists/listinfo/wxperl-users
|