Issue 1797 in v8: Chrome - toLocaleString() function is not converting the number into local format.

25 views
Skip to first unread message

codesite...@google.com

unread,
Oct 28, 2011, 11:27:38 AM10/28/11
to v8-...@googlegroups.com
Status: New
Owner: ----

New issue 1797 by hussain...@gmail.com: Chrome - toLocaleString() function
is not converting the number into local format.
http://code.google.com/p/v8/issues/detail?id=1797

toLocaleString() function is not converting the number into local format.

actually website will convert the numbers automatically.
eg:
india : 1,00,000.00
Germany : 1.00.000,00

please check the attachment for more details.

Attachments:
issue Chrome.jpg 273 KB
jsLocaleString.htm 240 bytes

codesite...@google.com

unread,
Oct 31, 2011, 5:02:04 AM10/31/11
to v8-...@googlegroups.com
Updates:
Status: WorkingAsIntended

Comment #1 on issue 1797 by yan...@chromium.org: Chrome - toLocaleString()

function is not converting the number into local format.
http://code.google.com/p/v8/issues/detail?id=1797

The ES5 spec says:
"Produces a String value that represents this Number value formatted
according to the conventions of the host environment's current locale. This
function is implementation-dependent, and it is permissible, but not
encouraged, for it to return the same thing as toString."

While v8 does not offer the best solution right now, the current behavior
*is* ES5 conform.

codesite...@google.com

unread,
Nov 23, 2011, 2:08:25 PM11/23/11
to v8-...@googlegroups.com

Comment #2 on issue 1797 by dried...@gmail.com: Chrome - toLocaleString()
function is not converting the number into local format.
http://code.google.com/p/v8/issues/detail?id=1797

Is there a suggested work around until the best solution is offered? Will
this be resolved in the future?

codesite...@google.com

unread,
Nov 24, 2011, 4:14:55 AM11/24/11
to v8-...@googlegroups.com

Comment #3 on issue 1797 by yan...@chromium.org: Chrome - toLocaleString()
function is not converting the number into local format.
http://code.google.com/p/v8/issues/detail?id=1797

In the short term there are no plans to change this as long as its spec
conform. However, I can't say that this will stay this way in the long term.

For a work around I would suggest one of the widely available frameworks
such as http://www.datejs.com/

codesite...@google.com

unread,
Nov 16, 2012, 1:33:56 PM11/16/12
to v8-...@googlegroups.com

Comment #4 on issue 1797 by c...@chromium.org: Chrome - toLocaleString()
function is not converting the number into local format.
http://code.google.com/p/v8/issues/detail?id=1797

The code.google.com/p/v8-i18n library overrides this method in v8 (among
others, see http://code.google.com/p/v8-i18n/wiki/BuiltInOverrides) and
provides much better results.

The overrides will be available in Chrome v24.

The v8-i18n library implements ECMA 402 standard for JavaScript
internationalization.

Reply all
Reply to author
Forward
0 new messages