< prev index next >
src/java.base/share/classes/sun/util/locale/provider/NumberFormatProviderImpl.java
Print this page
rev 47480 : [mq]: 8176841
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -171,13 +171,18 @@
int choice) {
if (locale == null) {
throw new NullPointerException();
}
+ // Check for region override
+ Locale override = locale.getUnicodeLocaleType("nu") == null ?
+ CalendarDataUtility.findRegionOverride(locale).orElse(locale) :
+ locale;
+
LocaleProviderAdapter adapter = LocaleProviderAdapter.forType(type);
- String[] numberPatterns = adapter.getLocaleResources(locale).getNumberPatterns();
- DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(locale);
+ String[] numberPatterns = adapter.getLocaleResources(override).getNumberPatterns();
+ DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(override);
int entry = (choice == INTEGERSTYLE) ? NUMBERSTYLE : choice;
DecimalFormat format = new DecimalFormat(numberPatterns[entry], symbols);
if (choice == INTEGERSTYLE) {
format.setMaximumFractionDigits(0);
< prev index next >