I am afraid that this patch breaks functionality in formats other than
currency.
https://codereview.chromium.org/1231613006/diff/140001/src/i18n.cc
File src/i18n.cc (right):
https://codereview.chromium.org/1231613006/diff/140001/src/i18n.cc#newcode267
src/i18n.cc:267:
Two main worries:
1. Looks like the code uses the ICU defaults no matter if the javascript
code specified min/max fraction digits or not.
2. It is not OK to use the currency defaults for all number formatting
types.
2.1 There are currencies that use zero fraction digits by default,
because the currency does not have sub-units.
Example for ja_JP:
currency: ¥54,306
number: 54,306.405
percent: 64%
scientific: 5.4306404797E4
2.2 The currency precision is not only locale-dependent, but also
currency dependent. For instance all locales will format the Japanese
Yen with not fractional part. So ucurr_getDefaultFractionDigits, which
does not look at the currency code, will not do the right thing.
Why not just use what ICU returns, "as is", unless caller of the
Javascript API specified the min / max fraction digits?
https://codereview.chromium.org/1231613006/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.