ICU 61.1
61.1

A class that defines a rounding strategy based on a number of fraction places and optionally significant digits to be used when formatting numbers in NumberFormatter. More...
#include <numberformatter.h>
Public Member Functions  
Rounder  withMinDigits (int32_t minSignificantDigits) const 
Ensure that no less than this number of significant digits are retained when rounding according to fraction rules. More...  
Rounder  withMaxDigits (int32_t maxSignificantDigits) const 
Ensure that no more than this number of significant digits are retained when rounding according to fraction rules. More...  
Public Member Functions inherited from icu::number::Rounder  
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 Public Member Functions inherited from icu::number::Rounder  
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 based on a number of fraction places and optionally significant digits to be used when formatting numbers in NumberFormatter.
To create a FractionRounder, use one of the factory methods on Rounder.
Definition at line 1031 of file numberformatter.h.
Rounder icu::number::FractionRounder::withMaxDigits  (  int32_t  maxSignificantDigits  )  const 
Ensure that no more than this number of significant digits are retained when rounding according to fraction rules.
For example, with integer rounding, the number 123.4 becomes "123". However, with maximum figures set to 2, 123.4 becomes "120" instead.
This setting does not affect the number of trailing zeros. For example, with fixed fraction of 2, 123.4 would become "120.00".
maxSignificantDigits  Round the number to no more than this number of significant figures. 
Rounder icu::number::FractionRounder::withMinDigits  (  int32_t  minSignificantDigits  )  const 
Ensure that no less than this number of significant digits are retained when rounding according to fraction rules.
For example, with integer rounding, the number 3.141 becomes "3". However, with minimum figures set to 2, 3.141 becomes "3.1" instead.
This setting does not affect the number of trailing zeros. For example, 3.01 would print as "3", not "3.0".
minSignificantDigits  The number of significant figures to guarantee. 