ICU 60.3
60.3
|
A class that defines a rounding strategy parameterized by a rounding increment to be used when formatting numbers in NumberFormatter. More...
#include <numberformatter.h>
Public Member Functions | |
Rounder | withMinFraction (int32_t minFrac) const |
Specifies the minimum number of fraction digits to render after the decimal separator, padding with zeros if necessary. More... | |
![]() | |
Rounder | withMode (UNumberFormatRoundingMode roundingMode) const |
Sets the rounding mode to use when picking the direction to round (up or down). More... | |
Friends | |
class | Rounder |
Additional Inherited Members | |
![]() | |
static Rounder | unlimited () |
Show all available digits to full precision. More... | |
static FractionRounder | integer () |
Show numbers rounded if necessary to the nearest integer. More... | |
static FractionRounder | fixedFraction (int32_t minMaxFractionPlaces) |
Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal separator). More... | |
static FractionRounder | minFraction (int32_t minFractionPlaces) |
Always show at least a certain number of fraction places after the decimal separator, padding with zeros if necessary. More... | |
static FractionRounder | maxFraction (int32_t maxFractionPlaces) |
Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal separator). More... | |
static FractionRounder | minMaxFraction (int32_t minFractionPlaces, int32_t maxFractionPlaces) |
Show numbers rounded if necessary to a certain number of fraction places (numerals after the decimal separator); in addition, always show at least a certain number of places after the decimal separator, padding with zeros if necessary. More... | |
static DigitRounder | fixedDigits (int32_t minMaxSignificantDigits) |
Show numbers rounded if necessary to a certain number of significant digits or significant figures. More... | |
static DigitRounder | minDigits (int32_t minSignificantDigits) |
Always show at least a certain number of significant digits/figures, padding with zeros if necessary. More... | |
static DigitRounder | maxDigits (int32_t maxSignificantDigits) |
Show numbers rounded if necessary to a certain number of significant digits/figures. More... | |
static DigitRounder | minMaxDigits (int32_t minSignificantDigits, int32_t maxSignificantDigits) |
Show numbers rounded if necessary to a certain number of significant digits/figures; in addition, always show at least a certain number of significant digits, padding with zeros if necessary. More... | |
static IncrementRounder | increment (double roundingIncrement) |
Show numbers rounded if necessary to the closest multiple of a certain rounding increment. More... | |
static CurrencyRounder | currency (UCurrencyUsage currencyUsage) |
Show numbers rounded and padded according to the rules for the currency unit. More... | |
A class that defines a rounding strategy parameterized by a rounding increment to be used when formatting numbers in NumberFormatter.
To create an IncrementRounder, use one of the factory methods on Rounder.
Definition at line 978 of file numberformatter.h.
Rounder icu::number::IncrementRounder::withMinFraction | ( | int32_t | minFrac | ) | const |
Specifies the minimum number of fraction digits to render after the decimal separator, padding with zeros if necessary.
By default, no trailing zeros are added.
For example, if the rounding increment is 0.5 and minFrac is 2, then the resulting strings include "0.00", "0.50", "1.00", and "1.50".
Note: In ICU4J, this functionality is accomplished via the scale of the BigDecimal rounding increment.
minFrac | The minimum number of digits after the decimal separator. |