You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns a string: "0.002" on a System with locale where "." is the decimal mark.
When you use this value and set it back to any variable or use it in e.g. comparison operator like "<"
it is automatically converted to a number.
In some countries the decimal mark is not a point, it is a ",". The return string you get is: "0,002". When you use this in a numeric context e.g. comparison you get the 'Argument "0,002.." isn't numeric in ...' error.
Workaround:
After reading "numerical" values from a widget do after reading
$var =~ tr/,/./;
Better solution:
Change the API, return real numeric values, not strings.
Example progressbar1/2/3.pl
$value = $progressbar->VALUE;
Returns a string: "0.002" on a System with locale where "." is the decimal mark.
When you use this value and set it back to any variable or use it in e.g. comparison operator like "<"
it is automatically converted to a number.
In some countries the decimal mark is not a point, it is a ",". The return string you get is: "0,002". When you use this in a numeric context e.g. comparison you get the 'Argument "0,002.." isn't numeric in ...' error.
Workaround:
After reading "numerical" values from a widget do after reading
$var =~ tr/,/./;
Better solution:
Change the API, return real numeric values, not strings.
Other countries using the ",":
https://en.wikipedia.org/wiki/Decimal_mark
The text was updated successfully, but these errors were encountered: