Index: src/i18n.js |
diff --git a/src/i18n.js b/src/i18n.js |
index a4556c75637006135575d9f0849f75e1cdc8edd1..6b6d4afa63b43f2495068abf9c691818eb7d1f39 100644 |
--- a/src/i18n.js |
+++ b/src/i18n.js |
@@ -1099,11 +1099,19 @@ function initializeNumberFormat(numberFormat, locales, options) { |
var mnid = getNumberOption(options, 'minimumIntegerDigits', 1, 21, 1); |
defineWEProperty(internalOptions, 'minimumIntegerDigits', mnid); |
- var mnfd = getNumberOption(options, 'minimumFractionDigits', 0, 20, 0); |
- defineWEProperty(internalOptions, 'minimumFractionDigits', mnfd); |
+ var mnfd = options['minimumFractionDigits']; |
+ var mxfd = options['maximumFractionDigits']; |
+ if (!IS_UNDEFINED(mnfd) || !internalOptions.style === 'currency') { |
+ mnfd = getNumberOption(options, 'minimumFractionDigits', 0, 20, 0); |
+ defineWEProperty(internalOptions, 'minimumFractionDigits', mnfd); |
+ } |
- var mxfd = getNumberOption(options, 'maximumFractionDigits', mnfd, 20, 3); |
- defineWEProperty(internalOptions, 'maximumFractionDigits', mxfd); |
+ if (!IS_UNDEFINED(mxfd) || !internalOptions.style === 'currency') { |
+ mnfd = IS_UNDEFINED(mnfd) ? 0 : mnfd; |
+ fallback_limit = (mnfd > 3) ? mnfd : 3; |
+ mxfd = getNumberOption(options, 'maximumFractionDigits', mnfd, 20, fallback_limit); |
+ defineWEProperty(internalOptions, 'maximumFractionDigits', mxfd); |
+ } |
var mnsd = options['minimumSignificantDigits']; |
var mxsd = options['maximumSignificantDigits']; |
@@ -1157,8 +1165,6 @@ function initializeNumberFormat(numberFormat, locales, options) { |
internalOptions, |
resolved); |
- // We can't get information about number or currency style from ICU, so we |
- // assume user request was fulfilled. |
if (internalOptions.style === 'currency') { |
ObjectDefineProperty(resolved, 'currencyDisplay', {value: currencyDisplay, |
writable: true}); |