[Javascript] thousand separator

Hassan Schroeder hassan at webtuitive.com
Thu Jun 3 11:39:40 CDT 2004


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...

-- 
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.





More information about the Javascript mailing list