Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(250)

Issue 7129051: Adding support for number formating to the JS i18n API. (Closed)

Created:
9 years, 6 months ago by Nebojša Ćirić
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Adding support for number formating to the JS i18n API. This is the last part of the API that belongs in public spec. Methods supported: - format - derive Options supported: - style (decimal, scientific, currency and percent) - pattern - skeleton TEST= Visit i18n.kaziprst.org/numberformat.html Committed: http://code.google.com/p/v8/source/detail?r=8379

Patch Set 1 : '' #

Total comments: 4

Patch Set 2 : Removed hacky NaN handling. ICU can handle NaNs for us. #

Patch Set 3 : Added currencyCode setting. Improved skeleton mapping code. #

Total comments: 22

Patch Set 4 : Jungshik comments + I18NUtils::AsciiToUChar #

Total comments: 4

Patch Set 5 : Final fixes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+554 lines, -0 lines) Patch
M src/extensions/experimental/experimental.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
M src/extensions/experimental/i18n.js View 1 2 3 1 chunk +96 lines, -0 lines 0 comments Download
M src/extensions/experimental/i18n-extension.cc View 2 chunks +3 lines, -0 lines 0 comments Download
M src/extensions/experimental/i18n-utils.h View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M src/extensions/experimental/i18n-utils.cc View 1 2 3 1 chunk +19 lines, -0 lines 0 comments Download
A src/extensions/experimental/number-format.h View 1 1 chunk +71 lines, -0 lines 0 comments Download
A src/extensions/experimental/number-format.cc View 1 2 3 4 1 chunk +356 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Nebojša Ćirić
Jungshink: please take a look at ICU calls and overall logic. Mads: I can't use ...
9 years, 6 months ago (2011-06-09 22:40:11 UTC) #1
Mads Ager (chromium)
This version of NaN handling is not going to work since NaN is not equal ...
9 years, 6 months ago (2011-06-10 07:25:30 UTC) #2
Mads Ager (chromium)
Doesn't ICU deal with NaN on its own? I would have guessed that ICU would ...
9 years, 6 months ago (2011-06-10 07:29:46 UTC) #3
Nebojša Ćirić
Sorry, I was away Fri-Mon. Not ready for another review. I'll add currencyCode (to match ...
9 years, 6 months ago (2011-06-14 21:46:21 UTC) #4
Nebojša Ćirić
PTAL I did one more pass over the code to fix couple of skeleton issues. ...
9 years, 6 months ago (2011-06-15 22:19:00 UTC) #5
Mads Ager (chromium)
The V8 API parts LGTM
9 years, 6 months ago (2011-06-16 09:55:07 UTC) #6
jungshik at Google
http://codereview.chromium.org/7129051/diff/11004/src/extensions/experimental/i18n.js File src/extensions/experimental/i18n.js (right): http://codereview.chromium.org/7129051/diff/11004/src/extensions/experimental/i18n.js#newcode267 src/extensions/experimental/i18n.js:267: /^[a-zA-Z]{3}$/.test(settings['currencyCode'])) { Is it your intent to allow mixed-case ...
9 years, 6 months ago (2011-06-16 18:08:19 UTC) #7
Nebojša Ćirić
http://codereview.chromium.org/7129051/diff/11004/src/extensions/experimental/i18n.js File src/extensions/experimental/i18n.js (right): http://codereview.chromium.org/7129051/diff/11004/src/extensions/experimental/i18n.js#newcode267 src/extensions/experimental/i18n.js:267: /^[a-zA-Z]{3}$/.test(settings['currencyCode'])) { I don't think it's a problem to ...
9 years, 6 months ago (2011-06-17 17:48:45 UTC) #8
jungshik at Google
LGTM with nits below taken care of. http://codereview.chromium.org/7129051/diff/19003/src/extensions/experimental/number-format.cc File src/extensions/experimental/number-format.cc (right): http://codereview.chromium.org/7129051/diff/19003/src/extensions/experimental/number-format.cc#newcode250 src/extensions/experimental/number-format.cc:250: // Find ...
9 years, 6 months ago (2011-06-21 23:28:41 UTC) #9
Nebojša Ćirić
9 years, 6 months ago (2011-06-22 16:50:41 UTC) #10
http://codereview.chromium.org/7129051/diff/19003/src/extensions/experimental...
File src/extensions/experimental/number-format.cc (right):

http://codereview.chromium.org/7129051/diff/19003/src/extensions/experimental...
src/extensions/experimental/number-format.cc:250: // Find how many U+00A4 are
there. There is at least one.
On 2011/06/21 23:28:41, Jungshik Shin wrote:
> nit: Add a comment that non-consecutive U+00A4's have been taken care of in
> i18n.js

Done.

http://codereview.chromium.org/7129051/diff/19003/src/extensions/experimental...
src/extensions/experimental/number-format.cc:347: return true;
On 2011/06/21 23:28:41, Jungshik Shin wrote:
> nit: You can combine the above 4 lines to "return !!U_SUCCESS(status);" 

Done.

Powered by Google App Engine
This is Rietveld 408576698