Some text fields present floating point numbers with
"," as decimal point if the decimal format of the
default locale defines it this way (e. g. the german
Logged In: YES
Sorry, I'm not entirely certain what you are saying. Do
you mean that they do that, and they shouldn't? Or that
they don't do it, and they should?
I would generally say that localized number formats
should be used everywhere, but I'm open to comments
Logged In: YES
Sorry, i'm not a native English speaker. I will try to be
The fields show the values as e. g. "23,4". But they show it
in red because the value can't be parsed as float due to the
I assume, the program uses the DecimalFormat class to show
the values (with comma in respect of the locale), but uses
Double.parseDouble for parsing, which expects a real decimal
point regardless of the locale.
I think I have this fixed, but I don't have any way of
testing it to make sure. Could you try this out with the
1.1 beta version (see the Open Discussion list for the
url to download it from), and confirm whether or not it is
Floating point entries with comma are now interpreted
properly, but there is now another problem:
The locale-respecting fields can't parse the exponential
representation of a number correctly, e. g. "3,2e4" is
interpreted as 3.2 (because parsing simply stops before the
"e") instead of the expected 32000.
The parse method of DecimalFormat can't handle exponential
numbers. So i would suggest to let all number fields simply
ignore the locale (perhaps until someone writes a
locale-aware number parser which can handle it) because i
think most people (including me) can live with "." as
Ok. It now uses . as the decimal point regardless of
locale, and correctly parses exponential notation.
Log in to post a comment.