Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language specific Problems #6

Open
hisnameishb opened this issue Feb 22, 2017 · 0 comments
Open

Language specific Problems #6

hisnameishb opened this issue Feb 22, 2017 · 0 comments

Comments

@hisnameishb
Copy link

hisnameishb commented Feb 22, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant