[Javascript] thousand separator

Flavio Gomes flavio at economisa.com.br
Thu Jun 3 12:42:06 CDT 2004


Hassan Schroeder wrote:

> Shawn Milo wrote:
>
>> Interesting.  I didn't know that.  Well, I suppose
>> that the user will have to take care of modifying
>> the script in that case, because I don't know how,
>> if it's even possible, to detect the regional values.
>>
>> Is that something that can be harvested from the
>> browser somehow, as the current UTC offset can be?
>
>
> That's a darn good question :-)
>
> Locale support is slim in JS. There's obviously a private method
> under the hood, because Date has a `toLocaleString()` method.
>
> In my copy of Moz (1.6), `navigator.language` gives me "en_US",
> but Opera 7.22 just gives me "en" and IE 5.5 says "undefined".
> However, that same IE is sending an Accept-Language header of
> "en-us" so maybe the only reliable way to make the locale info
> available to JS is to capture it server-side and write it into
> a cookie to send back.
>
> A bit convoluted, but...
>

on IE6  = > navigator.systemLanguage = pt-br
 ^^ weeee!  Does it help?

---
Flavio Gomes
flavio at economisa.com.br






More information about the Javascript mailing list