I18N Issue with EFloat

1 view
Skip to first unread message

felix

unread,
Jun 30, 2006, 3:32:07 AM6/30/06
to jmatter
Hi Eitan,

there's a problem with EFloat, as it uses the current locale to render
the number to a string and the hard-wired Double.parse() to parse
strings to numbers. If your locale has a different decimal separator
you'll run into problems...

I did the following adhoc fix in EFloat:


public void parseValue(String stringValue)
{
double doubleVal = 0;
try {
doubleVal = format.parse(stringValue).doubleValue();
} catch (ParseException e) {
throw new RuntimeException(e);
}
setValue(doubleVal);
}

Best Regards,

Felix

Eitan Suez

unread,
Jun 30, 2006, 8:42:04 AM6/30/06
to jma...@googlegroups.com
i will be integrating your fix back into the codebase.
thank you.

/ eitan

eitan

unread,
Jun 30, 2006, 2:06:06 PM6/30/06
to jmatter
there's another issue here. i can't assume that all string
representations of FloatEO
will match the format in question. i think what i'll do is try
Double.parseDouble and
fallback to format.parse

Reply all
Reply to author
Forward
0 new messages