ICU-6694 Move setting of zeroDigit from NummberFormat to DecimalFormatSymbols per Yoshito's suggestion
X-SVN-Rev: 25300
This commit is contained in:
parent
c7eebf2873
commit
468ca36b11
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*******************************************************************************
|
||||
* Copyright (C) 1997-2008, International Business Machines Corporation and *
|
||||
* Copyright (C) 1997-2009, International Business Machines Corporation and *
|
||||
* others. All Rights Reserved. *
|
||||
*******************************************************************************
|
||||
*
|
||||
@ -26,6 +26,8 @@
|
||||
#include "unicode/decimfmt.h"
|
||||
#include "unicode/ucurr.h"
|
||||
#include "unicode/choicfmt.h"
|
||||
#include "unicode/unistr.h"
|
||||
#include "unicode/numsys.h"
|
||||
#include "ucurrimp.h"
|
||||
#include "cstring.h"
|
||||
#include "locbased.h"
|
||||
@ -160,6 +162,14 @@ DecimalFormatSymbols::initialize(const Locale& loc, UErrorCode& status,
|
||||
if (U_SUCCESS(status)) {
|
||||
initialize(numberElements, numberElementsStrLen, numberElementsLength);
|
||||
|
||||
// Attempt to set the zero digit based on the numbering system for the locale requested
|
||||
//
|
||||
NumberingSystem* ns = NumberingSystem::createInstance(loc,status);
|
||||
if (U_SUCCESS(status) && ns->getRadix() == 10 && !ns->isAlgorithmic()) {
|
||||
UnicodeString zeroDigit(ns->getDescription(),0,1);
|
||||
setSymbol(kZeroDigitSymbol,zeroDigit);
|
||||
}
|
||||
|
||||
// Obtain currency data from the currency API. This is strictly
|
||||
// for backward compatibility; we don't use DecimalFormatSymbols
|
||||
// for currency data anymore.
|
||||
|
@ -914,8 +914,6 @@ NumberFormat::makeInstance(const Locale& desiredLocale,
|
||||
r->setDefaultRuleSet(ns->getDescription(),status);
|
||||
f = (NumberFormat *) r;
|
||||
} else {
|
||||
UnicodeString zeroDigit(ns->getDescription(),0,1);
|
||||
symbolsToAdopt->setSymbol(DecimalFormatSymbols::kZeroDigitSymbol,zeroDigit);
|
||||
f = new DecimalFormat(pattern, symbolsToAdopt, status);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user