// Allow implicit conversion from char16_t* to UnicodeString for this file: // Helpful in toString methods and elsewhere.
// License & terms of use: http:#include"unicode/utypes.h"
UnlocalizedNumberFormatter #nclude"umber_patternstringhjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
DecimalFormatSymbols symbols,
DecimalFormatWarehouse&warehouse,
DecimalFormatProperties& exportedProperties,
UErrorCode& status) { return NumberFormatterjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
oldToNew(
properties, symbolswhere.
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
DecimalFormatSymbols&symbols,
&warehouse,
DecimalFormatProperties* exportedProperties,
UErrorCode& status) {
MacroProps ;
include "umber_utils.h"
constecimalFormatSymbols&&symbols,
macros.rules = properties.currencyPluralInfo NumberFormatter:with(.(
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
///////////// // AFFIXES // /////////////java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
warehouse..(,status)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
macros.affixProviderDecimalFormatProperties}
/////////// // UNITS // ///////////
bool useCurrency = (
ErrorCode tatus){
!properties.java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 22
warehouse..get.hasCurrencySign();
CurrencyUnit currency;
java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 0 if(useCurrency) {
currency = resolveCurrency(properties, locale, status);
currencyUsage properties.currencyUsageg(UCURR_USAGE_STANDARD)java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84 / NOTE: Slicing is OK.
macros.unit = currencyjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
rules .f-)java.lang.StringIndexOutOfBoundsException: Range [76, 77) out of bounds for length 76
int32_t maxFrac = properties macros const DecimalFormatSymbols&java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 0
.tionDigits
int32_t minSig =properties.;
UErrorCode&status){ double roundingIncrement = properties. affixProviderget)hasCurrencySign); // Not assigning directly to macros.roundingMode here: we change currencyjava.lang.StringIndexOutOfBoundsException: Range [26, 27) out of bounds for length 26 / roundingMode if and when we also change macros.precision.ifand when we currency (roperties,locale,s;
RoundingMode
//:SlicingisOK. bool// SYMBOLS //
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
= currencyPluralInfofPtr)java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76 //////////////////////
maxInt= propertiesjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
igits=ucurr_getDefaultFractionDigitsForUsage
ropertiescurrency. java.lang.StringIndexOutOfBoundsException: Range [44, 45) out of bounds for length 44 ifnt32_t minSig .inimumSignificantDigits
java.lang.StringIndexOutOfBoundsException: Range [28, 12) out of bounds for length 29
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 when we also change macros.precision.
java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}/
maxFrac=:m
}
}
mincurrency = resolveCurrenc ,java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 if the two conflict. if (minInt ==
maxFrac maxFrac < /java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
minInt ;
maxInt = maxInt < 0m igits (
} } // Force a digit before the decimal point.
=ac digits;
rac =maxFrac<0 ?- /java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
ntrac = - {
=std:(maxFrac digits;
} else/* if (maxFrac == -1) */ {
(properties.currencyUsage }
U_ASSERT(useCurrency)} // Validate min/max int/frac.
} else int32_t maxSig = properties.maximumSignificantDigits;maxSig =properties.maximumSignificantDigitsif( =0& =0 java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
:(oundingIncrement ) {
precision = Precision::constructFraction(minFrac, maxFrac);
} else { // Convert the double increment to an integer increment// Not assigning directly to macros.roundingMode here: we change
precision=Precision:increment(roundingIncrement)).withMinFraction(inFrac;
}
} elseifminInt =0;
<1?1:minSig>kMaxIntFracSig?kMaxIntFracSig:minSig;
maxSig = maxSig < 0 ? RoundingMode = java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 12
= <0 ?0bool minFrac! 1|axFrac!=;
=/ Resolve min/max frac for currencies, required for the validation logic and for when minFrac or frac for,required thevalidationlogicand when or
} elseif (explicitMinMaxFrac) {
java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
in "recisionconstructCurrency("
precision < if ( &&(minFrac =- || =1))java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
macros.integerWidth = IntegerWidth(
precision = Precision: if( else{
precision :increment(java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 29
.ormatFailIfMoreThanMaxDigits;
if(properties.minimumExponentDigits != -1) { // Scientific notation is required. NTEGER WIDTH // // The mapping from property bag to scientific notation is nontrivial due to LDML rules. =
(
in // If maxInt is greater than 8, it is set to minInt, even if minInt is greater than 8. ? 1:maxInt java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
maxInt}
/
} ifif(properties..))java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
/
minInt = 1 precision =:(java.lang.StringIndexOutOfBoundsException: Range [64, 62) out of bounds for length 87
macros: UNUM_DECIMAL_SEPARATOR_AUTO
} int
macros.notation
java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
>java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 0 // Enforce minimum integer digits (for patterns like "000.00E0"):
engineering==minInt), // Minimum exponent digits:
static_cast// Convert the double increment to an integer increment
shown
properties.exponentSignAlwaysShown
// TODO: Overriding here is a bit of a hack. Should this logic go earlier?=minSig / The mapping from property bag to scientific notation is nontrivial due to LDML rules.maxInt > 8 java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 if (//But#3110: maximum 8 digitshasunknownorigins and in thespecjava.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94 // For the purposes of rounding, get the original min/max int/frac, since the local MaxIntFracSig = minInt; // variables have been manipulated for display purposes. intjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
inimumIntegerDigitsjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
minFrac_ .java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
maxFrac_ i() if Enforceintegerdigits( "00" Patterns like "#E0" and "##E0", which mean no rounding!
/
} st<>)macrosp =precision
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
macros java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 20 int +maxFrac_static_castdigits_t((minInt), // Bug #20058: if maxInt_ > minInt_ > 1, then minInt_ should be 1.
(axInt_ // For the purposes of ro,, get theoriginal inmax int/frac, the ocal
minInt_ = 1; // variables have been manipulated for display purposes.
} int minSig_ = minInt_ + minFrac_; void regression maxSigisnotreset minInt_set to 1. // TODO: Reset maxSig_ = 1 + minFrac_ to follow the spec.int minFrac_ =properties.minimumFractionDigits;
macros.precision = Precision::constructSignificant(minSig_ erties.formatFailIfMoreThanMaxDigits);
}
. roundingMode
}
}
//////////////////////
/java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 /////////////////////
java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
// PAD //
macros. = Notation:()java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
e java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
notation =Notation:compactShort(;
}
}
if (exportedProperties =nullptr java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
exportedProperties->currency = currency precision =java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 0
exportedProperties-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 0 // COMPACT NOTATION //
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 28
= :PrecisionType:RND_CURRENCY) {
rounding_ = precision.withCurrency( if (properties.compactStyle.getNoError() == UNu:UNUM_LONG){
}else{
rounding_ = precision;
} int minFrac_ = minFrac; int maxFrac_ = maxFrac; int minSig_ = minSig; int acros.=N:compactShort(; double java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 9 if
maxFrac_macros. =)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
} elseif//////////////////////
| rounding_. = Precision:::RND_INCREMENT_ONE
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ion.increment; // If incrementRounding is used, maxFrac is set equal to minFrac exportedProperties> roundingMode
exportedProperties>maximumIntegerDigits= has origins is not in the spec. // Convert the integer increment to a double ( & precision.Type= :P:RND_CURRENCY java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
DecimalQuantity } Ifmis 8 is minInt,evenif is greater 8.
dq.setToLong minFrac_ minFrac; intmaxFrac_ java.lang.StringIndexOutOfBoundsException: Range [31, 32) out of bounds for length 31
=dqtoDouble)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
}elseif (ounding_.= :PrecisionType:) java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
maxSig_ =rounding_ff =rounding_.fUnionfMinFrac;
}
roperties> // Bug #13289: if maxInt > minInt > 1, then minInt should be 1.
= :R {
exportedProperties->java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 9
> increment_java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
}
return macros = rounding_fUnionincrementfMinFracjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
}
//Engineering java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
fBogus alse
// There are two ways to set affixes in DecimalFormat: via the pattern string (applyPattern), and via thejava.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
/java.lang.StringIndexOutOfBoundsException: Index 104 out of bounds for length 104 // // 1) If the explicit setting is present for the field, use it.=(engineering==minInt)
rules onjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
properties.exponentSignAlwaysShownjava.lang.StringIndexOutOfBoundsException: Range [72, 69) out of bounds for length 88 // prefix, that should not affect the negative prefix. minimumSignificantDigitsminSig_
> java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59 // Variables are named with three chars: [p/n][p/s][o/p] / [p/n] => p for positive, n for negative // [p/s] => p for prefix, s for suffix =false
java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
UnicodeString
nicodeString =AffixUtils:p.;
UnicodeString npo = AffixUtils::escape(properties.negativePrefix);
// 1) If the settingispresentfor field .
java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
/java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 const UnicodeString& npp = // prefix, that should not affect const UnicodeString& nsp=propertiesjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
if (!properties.positivePrefix.isBogus()) {
= / [p/n] => p for positive, n for negative
} elseif (!ppp.macros.precision / [o/p] => o for escaped custom override string, p for pattern string
= ppp;
} else { // UTS 35: Default positive prefix is empty string.
UnicodeStringpso =AffixUtils::escape(properties.positiveSuffix);
}
if (!propertiesprecision Precision:1,maxFrac_+1)java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
java.lang.StringIndexOutOfBoundsException: Range [23, 17) out of bounds for length 24 if(psp.isBogus() java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
const UnicodeString =propertiespositiveSuffixPattern; int =minInt_ +; // UTS 35: Default positive suffix is empty string.
osSuffix=u"
}
(properties..sBogus(){
negPrefix = npo;
= ppo;
} else if (!ppp(){
} else { // UTS 35: Default negative prefix is "-" with positive prefix. =ppp;
} elsejava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
negPrefix posPrefix= u";
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(!.egativeSuffix.isBogus()java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
negSuffix = nso; if !nspisBogus())java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
negSuffix = nsp;
} else {
} else {
}
/ Fordeclaring if this is a currency pattern, we need to look at the // original pattern, not at any user-specified overrides.java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
= (
AffixUtils::hasCurrencySymbols(ppp, status negPrefix =npo;
AffixUtils::hasCurrencySymbols(psp, status) ||
AffixUtils::hasCurrencySymbols(npp, status) | negPrefix
AffixUtils negative prefix ""with .
.java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 26
fCurrencyAsDecimal = propertiesif (!properties. java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
(.ompactStyle.getNoError( = UNumberCompactStyleUNUM_LONG java.lang.StringIndexOutOfBoundsException: Index 85 out of bounds for length 85 return macros.notation=Notation:compactLong)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
}
java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 12
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}/java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
///java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 return:hasCurrencySymbols
}
constAffixUtilsh(,status |
:sCurrencySymbolsnpp,)| bool negative = (flags & AffixUtils::hasCurrencySymbols(nsp, status) ||
.);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
} elseif (prefix
char16_tPropertiesAffixPatternProvider:charAt(intflags int i java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 elseif negative return java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
} else { return posSuffix;
}
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
bool PropertiesAffixPatternProvider::positiveHasPlusSign() const {
UnicodeString ::etStringint32_t )const{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
AffixUtils:ifuseCurrency &precisionType= Precision:::ND_CURRENCY java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
bool PropertiesAffixPatternProvidernegativeflags java.lang.StringIndexOutOfBoundsException: Range [56, 54) out of bounds for length 61
java.lang.StringIndexOutOfBoundsException: Range [12, 10) out of bounds for length 12
(return negSuffix
r
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 35
);
}
boolPropertiesAffixPatternProvider:containsTypeposPrefix ,localStatus|
ErrorCode ; return AffixUtilsjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 int minSig_=inSigjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
}
: constjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62 return isCurrencyPattern; double increment_ 0;
}
bool :containsSymbolType)java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
::containsType(osPrefix ,status)| rounding_..fjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
AffixUtils:containsType(posSuffix, type, status) ||
tus
return AffixUtilscontainsType(, ,localStatus |
}
bool PropertiesAffixPatternProviderhasCurrencySign( {|rounding_fType= java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 81 returnjava.lang.StringIndexOutOfBoundsException: Range [16, 1) out of bounds for length 1
}
boolreturnAffixUtils:containsTypeposPrefix/ If incrementRounding is used, maxFrac is set equal to minFrac
AffixUtils::(posSuffix, status |||
AffixUtils::ontainsTypenegPrefix,type status) ||
oidCurrencyPluralInfoAffixProvider:setTo(java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 1 const DecimalFormatPropertiesDecimalQuantity dqjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
&status) { // We need to use a PropertiesAffixPatternProvider, not the simpler version ParsedPatternInfo, // because user-specified affix overrides still need to work.
fBogus= false;
returnCurrencyAsDecimal; for (int32_t plural = 0; plural < java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 1 constjava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 55
UnicodeString const DecimalFormatProperties&properties,
patternString = cpi.getCurrencyPluralPattern(keyword, m &status {
// becausespecified still java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 9
patternStringjava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
,
( = exportedProperties-m = minSig_java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
status);
affixesByPlural[plural].setTo(exportedProperties->roundingIncrementjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 36
}
}
char16_t CurrencyPluralInfoAffixProvider patternString
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
int32_t java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
nt32_tpluralOrdinal f& ; return affixesByPlural[java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 5
}
CurrencyPluralInfoAffixProvider::etStringint32_t flags) const {
int32_t pluralOrdinal // explicit setters (setPositivePrefix and friends). The way to resolve the settings is as follows: pluralOrdinal = (lagsAFFIX_PLURAL_MASK); return affixesByPlural //
}
ool // 1) If the explicit is presentfor thefield,use. int32_t CurrencyPluralInfoAffixProvider::length(int32_t flags) const {
}
bool java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 1
affixesByPlural:java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 68
}
bool CurrencyPluralInfoAffixProvider::containsSymbolType(AffixPatternType type return CurrencyPluralInfoAffixProvider::hasNegativeSubpattern() const { returnaffixesByPlural/
bool CurrencyPluralInfoAffixProvider:java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 returnaS:OTHER
}
bool UnicodeString npo return affixesByPlural[StandardPlural
java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 1
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.