Skip to content

Commit

Permalink
ICU-22900 Remove deprecated truncateStart and promote draft setMaximu…
Browse files Browse the repository at this point in the history
…mIntegerDigits
  • Loading branch information
sffc committed Sep 19, 2024
1 parent 09c5aa1 commit ec8ddd9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 37 deletions.
5 changes: 0 additions & 5 deletions icu4c/source/i18n/number_capi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,11 +317,6 @@ usnum_setMaximumIntegerDigits(USimpleNumber* unumber, int32_t maximumIntegerDigi
number->fNumber.setMaximumIntegerDigits(maximumIntegerDigits, *ec);
}

U_CAPI void U_EXPORT2
usnum_truncateStart(USimpleNumber* unumber, int32_t maximumIntegerDigits, UErrorCode* ec) {
usnum_setMaximumIntegerDigits(unumber, maximumIntegerDigits, ec);
}

U_CAPI void U_EXPORT2
usnum_setSign(USimpleNumber* unumber, USimpleNumberSign sign, UErrorCode* ec) {
auto* number = USimpleNumberData::validate(unumber, *ec);
Expand Down
4 changes: 0 additions & 4 deletions icu4c/source/i18n/number_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ void SimpleNumber::setMaximumIntegerDigits(uint32_t position, UErrorCode& status
fData->quantity.applyMaxInteger(position);
}

void SimpleNumber::truncateStart(uint32_t position, UErrorCode& status) {
setMaximumIntegerDigits(position, status);
}

void SimpleNumber::setSign(USimpleNumberSign sign, UErrorCode& status) {
if (U_FAILURE(status)) {
return;
Expand Down
14 changes: 1 addition & 13 deletions icu4c/source/i18n/unicode/simplenumberformatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,12 @@ class U_I18N_API SimpleNumber : public UMemory {
*/
void roundTo(int32_t power, UNumberFormatRoundingMode roundingMode, UErrorCode& status);

#ifndef U_HIDE_DRAFT_API
/**
* Sets the number of integer digits to the given amount, truncating if necessary.
*
* @draft ICU 75
* @stable ICU 75
*/
void setMaximumIntegerDigits(uint32_t maximumIntegerDigits, UErrorCode& status);
#endif // U_HIDE_DRAFT_API

#ifndef U_HIDE_DEPRECATED_API
/**
* Alias for setMaximumIntegerDigits.
* Will be removed after ICU 75.
*
* @deprecated ICU 75
*/
void truncateStart(uint32_t maximumIntegerDigits, UErrorCode& status);
#endif // U_HIDE_DEPRECATED_API

/**
* Pads the beginning of the number with zeros up to the given minimum number of integer digits.
Expand Down
16 changes: 1 addition & 15 deletions icu4c/source/i18n/unicode/usimplenumberformatter.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,27 +156,13 @@ U_CAPI void U_EXPORT2
usnum_setMinimumFractionDigits(USimpleNumber* unumber, int32_t minimumFractionDigits, UErrorCode* ec);


#ifndef U_HIDE_DRAFT_API
/**
* Sets the number of integer digits to the given amount, truncating if necessary.
*
* @draft ICU 75
* @stable ICU 75
*/
U_CAPI void U_EXPORT2
usnum_setMaximumIntegerDigits(USimpleNumber* unumber, int32_t maximumIntegerDigits, UErrorCode* ec);
#endif // U_HIDE_DRAFT_API


#ifndef U_HIDE_DEPRECATED_API
/**
* Alias for setMaximumIntegerDigits.
* Will be removed after ICU 75.
*
* @deprecated ICU 75
*/
U_CAPI void U_EXPORT2
usnum_truncateStart(USimpleNumber* unumber, int32_t maximumIntegerDigits, UErrorCode* ec);
#endif // U_HIDE_DEPRECATED_API


/**
Expand Down

0 comments on commit ec8ddd9

Please sign in to comment.