icu::number::CurrencyRounder Class Reference

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

#include <numberformatter.h>

Inheritance diagram for icu::number::CurrencyRounder:
icu::number::Rounder icu::UMemory

Public Member Functions

Rounder withCurrency (const CurrencyUnit &currency) const
 Associates a currency with this rounding strategy.

Friends

class Rounder

Detailed Description

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

To create a CurrencyRounder, use one of the factory methods on Rounder.

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

Definition at line 940 of file numberformatter.h.


Member Function Documentation

Rounder icu::number::CurrencyRounder::withCurrency ( const CurrencyUnit currency  )  const

Associates a currency with this rounding strategy.

Calling this method is not required, because the currency specified in unit() is automatically applied to currency rounding strategies. 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:
currency The currency to associate with this rounding strategy.
Returns:
A Rounder for chaining or passing to the NumberFormatter rounding() 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 11 May 2018 for ICU 60.1 by  doxygen 1.6.1