icu::number::IncrementPrecision Class Reference

A class that defines a rounding precision parameterized by a rounding increment to be used when formatting numbers in NumberFormatter. More...

#include <numberformatter.h>

Inheritance diagram for icu::number::IncrementPrecision:
icu::number::Precision icu::UMemory

Public Member Functions

Precision withMinFraction (int32_t minFrac) const
 Specifies the minimum number of fraction digits to render after the decimal separator, padding with zeros if necessary.

Friends

class Precision

Detailed Description

A class that defines a rounding precision parameterized by a rounding increment to be used when formatting numbers in NumberFormatter.

To create an IncrementPrecision, use one of the factory methods on Precision.

Draft:
This API may be changed in the future versions and was introduced in ICU 60

Definition at line 918 of file numberformatter.h.


Member Function Documentation

Precision icu::number::IncrementPrecision::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.

Parameters:
minFrac The minimum number of digits after the decimal separator.
Returns:
A precision for chaining or passing to the NumberFormatter precision() setter.
Draft:
This API may be changed in the future versions and was introduced in ICU 60

The documentation for this class was generated from the following file:

Generated on 8 May 2019 for ICU 63.1 by  doxygen 1.6.1