Default locale is actually default, not necessarily the local set.

I don't have access to my code at the moment so I'll have to do this from
the top of my head and without actually working code... but I'll give it a
try.

When a new user accesses the app I check the locale, to see what this is set
to, "default" or something else, if it is set to default then I force it to
the locale inferred by the user's IP address, if I have this local available
otherwise I set it to English.
There is such a thing as default in the list of locale's which usually is
_EN as far as I know.

I think what you are seeing is that the "default" locale you are using is
actually default (_EN) thus the number format is most likely set to
#,##0.0## instead of the #.##0,0## you are trying to use. I would suggest
simply telling the number formatter to use the _DE format (or simply the
same as the locale is set for for the user ;-)

Sorry for the lack of code, that the explanation is clear enough without it.

Regards,

Rob


On Mon, Jul 11, 2011 at 10:06 AM, tdk <kloe...@ics.de> wrote:

> I have severe problems, understanding and using
> com.google.gwt.i18n.client.Numberformat, hoping somebody out there can
> help and enlighten me.
>
> When I try to get a formatter via NumberFormat.getFormat(pattern) I
> get an InvalidPatternException even so my pattern is valid within the
> german locale, eg #.##0,0##.
> I know that the locale is set correctly and used by my app, because
> all the default texts, eg when loading data, show up in german.
>
> The documentation (and posts in various forms) say, that NumberFormat
> uses the default locale to get a formatter, with a specific pattern,
> which I assume in my case is de_DE, because it is set to this. So what
> am I doing wrong, am I missing?
>
> I'm using GWT 2.3
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to