ICU 73.2  73.2
Public Member Functions | Friends
icu::number::CurrencyPrecision Class Reference

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

#include <numberformatter.h>

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

Public Member Functions

Precision withCurrency (const CurrencyUnit &currency) const
 Associates a currency with this rounding precision.

Friends

class Precision

Detailed Description

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

To create a CurrencyPrecision, use one of the factory methods on Precision.

Stable:
ICU 60

Definition at line 914 of file numberformatter.h.


Member Function Documentation

Associates a currency with this rounding precision.

Calling this method is not required, because the currency specified in unit() is automatically applied to currency rounding precisions. However, this method enables you to override that automatic association.

This method also enables numbers to be formatted using currency rounding rules without explicitly using a currency format.

Parameters:
currencyThe currency to associate with this rounding precision.
Returns:
A precision for chaining or passing to the NumberFormatter precision() setter.
Stable:
ICU 60

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