diff options
Diffstat (limited to 'Build/source/libs/icu/icu-src/source/i18n/number_decimalquantity.h')
-rw-r--r-- | Build/source/libs/icu/icu-src/source/i18n/number_decimalquantity.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/Build/source/libs/icu/icu-src/source/i18n/number_decimalquantity.h b/Build/source/libs/icu/icu-src/source/i18n/number_decimalquantity.h index 107c09a96a5..862addf5d6c 100644 --- a/Build/source/libs/icu/icu-src/source/i18n/number_decimalquantity.h +++ b/Build/source/libs/icu/icu-src/source/i18n/number_decimalquantity.h @@ -81,11 +81,15 @@ class U_I18N_API DecimalQuantity : public IFixedDecimal, public UMemory { * * <p>If rounding to a power of ten, use the more efficient {@link #roundToMagnitude} instead. * - * @param roundingIncrement The increment to which to round. + * @param increment The increment to which to round. + * @param magnitude The power of 10 to which to round. * @param roundingMode The {@link RoundingMode} to use if rounding is necessary. */ - void roundToIncrement(double roundingIncrement, RoundingMode roundingMode, - UErrorCode& status); + void roundToIncrement( + uint64_t increment, + digits_t magnitude, + RoundingMode roundingMode, + UErrorCode& status); /** Removes all fraction digits. */ void truncate(); @@ -141,6 +145,13 @@ class U_I18N_API DecimalQuantity : public IFixedDecimal, public UMemory { bool adjustMagnitude(int32_t delta); /** + * Scales the number such that the least significant nonzero digit is at magnitude 0. + * + * @return The previous magnitude of the least significant digit. + */ + int32_t adjustToZeroScale(); + + /** * @return The power of ten corresponding to the most significant nonzero digit. * The number must not be zero. */ @@ -234,6 +245,9 @@ class U_I18N_API DecimalQuantity : public IFixedDecimal, public UMemory { /** Internal method if the caller already has a DecNum. */ DecimalQuantity &setToDecNum(const DecNum& n, UErrorCode& status); + /** Returns a DecimalQuantity after parsing the input string. */ + static DecimalQuantity fromExponentString(UnicodeString n, UErrorCode& status); + /** * Appends a digit, optionally with one or more leading zeros, to the end of the value represented * by this DecimalQuantity. @@ -315,6 +329,10 @@ class U_I18N_API DecimalQuantity : public IFixedDecimal, public UMemory { /** Returns the string without exponential notation. Slightly slower than toScientificString(). */ UnicodeString toPlainString() const; + /** Returns the string using ASCII digits and using exponential notation for non-zero + exponents, following the UTS 35 specification for plural rule samples. */ + UnicodeString toExponentString() const; + /** Visible for testing */ inline bool isUsingBytes() { return usingBytes; } @@ -518,6 +536,8 @@ class U_I18N_API DecimalQuantity : public IFixedDecimal, public UMemory { void _setToDecNum(const DecNum& dn, UErrorCode& status); + static int32_t getVisibleFractionCount(UnicodeString value); + void convertToAccurateDouble(); /** Ensure that a byte array of at least 40 digits is allocated. */ |