Re: DoubleConverter broken for locale vi (vietnamese)

2008-04-05 Thread Matthew Young
For the "vi" locale, "." is the radix mark and "," is the decimal mark.  So
"99,0" is "990". See this:

Double doubleValue = new Double("999.999");
String convertString = iConverter.convertToString(doubleValue,
newLocale("vi"));
System.out.println("Double value: " + doubleValue + ":=> converted
value: " + convertString);

Output:

Double value: 999.999:=> converted value: 9.999.999,999

This is how Sun has setup the DecimalFormat for the "vi" locale.  Nothing to
do with Wicket.

On Sat, Apr 5, 2008 at 9:27 AM, petrisoft <[EMAIL PROTECTED]> wrote:

>
> Hi I am using wicket 1.3.2 and it seems the Double Converter is broken for
> the Vietnamese language. How would I get round this?. It keeps on adding
> an
> extra zero.
>
> IConverter iConverter = new DoubleConverter();
> String valueStr = "99.0";
> Double convertValue = (Double) iConverter.convertToObject(valueStr, new
> Locale("vi"));
> System.out.println("Double entered String value: " + valueStr + ":=>
> converted value: " + convertValue);
>
> Output:
> Double entered String value: 99.0:=> converted value: 990.0
>
> Thanks Petrisoft
> --
> View this message in context:
> http://www.nabble.com/DoubleConverter-broken-for-locale-vi-%28vietnamese%29-tp16515228p16515228.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


DoubleConverter broken for locale vi (vietnamese)

2008-04-05 Thread petrisoft

Hi I am using wicket 1.3.2 and it seems the Double Converter is broken for
the Vietnamese language. How would I get round this?. It keeps on adding an
extra zero.

IConverter iConverter = new DoubleConverter();
String valueStr = "99.0";
Double convertValue = (Double) iConverter.convertToObject(valueStr, new
Locale("vi"));
System.out.println("Double entered String value: " + valueStr + ":=>
converted value: " + convertValue);

Output:
Double entered String value: 99.0:=> converted value: 990.0

Thanks Petrisoft
-- 
View this message in context: 
http://www.nabble.com/DoubleConverter-broken-for-locale-vi-%28vietnamese%29-tp16515228p16515228.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]