ICU 60.2 60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

Public Member Functions | Friends
icu::number::LocalizedNumberFormatter Class Reference

A NumberFormatter that has a locale associated with it; this means .format() methods are available. More...

`#include <numberformatter.h>`

Inheritance diagram for icu::number::LocalizedNumberFormatter:

## Public Member Functions
FormattedNumber | formatInt (int64_t value, UErrorCode &status) const
| Format the given integer number to a string using the settings specified in the NumberFormatter fluent setting chain. More...
FormattedNumber | formatDouble (double value, UErrorCode &status) const
| Format the given float or double to a string using the settings specified in the NumberFormatter fluent setting chain. More...
FormattedNumber | formatDecimal (StringPiece value, UErrorCode &status) const
| Format the given decimal number to a string using the settings specified in the NumberFormatter fluent setting chain. More...
| LocalizedNumberFormatter (const LocalizedNumberFormatter &other)
| Returns a copy of this LocalizedNumberFormatter. More...
| ~LocalizedNumberFormatter ()
| Destruct this LocalizedNumberFormatter, cleaning up any memory it might own. More...
Public Member Functions inherited from icu::number::NumberFormatterSettings< Derived >
Derived | notation (const Notation &notation) const
| Specifies the notation style (simple, scientific, or compact) for rendering numbers. More...
Derived | unit (const icu::MeasureUnit &unit) const
| Specifies the unit (unit of measure, currency, or percent) to associate with rendered numbers. More...
Derived | adoptUnit (const icu::MeasureUnit *unit) const
| Like unit(), but takes ownership of a pointer. More...
Derived | rounding (const Rounder &rounder) const
| Specifies the rounding strategy to use when formatting numbers. More...
Derived | grouping (const Grouper &grouper) const
| Specifies the grouping strategy to use when formatting numbers. More...
Derived | integerWidth (const IntegerWidth &style) const
| Specifies the minimum and maximum number of digits to render before the decimal mark. More...
Derived | symbols (const DecimalFormatSymbols &symbols) const
| Specifies the symbols (decimal separator, grouping separator, percent sign, numerals, etc.) to use when rendering numbers. More...
Derived | adoptSymbols (const NumberingSystem *symbols) const
| Specifies that the given numbering system should be used when fetching symbols. More...
Derived | unitWidth (const UNumberUnitWidth &width) const
| Sets the width of the unit (measure unit or currency). More...
Derived | sign (const UNumberSignDisplay &width) const
| Sets the plus/minus sign display strategy. More...
Derived | decimal (const UNumberDecimalSeparatorDisplay &width) const
| Sets the decimal separator display strategy. More...
Derived | padding (const impl::Padder &padder) const
| Set the padding strategy. More...
Derived | threshold (int32_t threshold) const
| Internal fluent setter to support a custom regulation threshold. More...
UBool | copyErrorTo (UErrorCode &outErrorCode) const
| Sets the UErrorCode if an error occurred in the fluent chain. More...

## Friends
class | NumberFormatterSettings< UnlocalizedNumberFormatter >
class | NumberFormatterSettings< LocalizedNumberFormatter >
class | UnlocalizedNumberFormatter

## Additional Inherited Members
Protected Attributes inherited from icu::number::NumberFormatterSettings< Derived >
impl::MacroProps | fMacros

## Detailed Description

A NumberFormatter that has a locale associated with it; this means .format() methods are available.

See also
  NumberFormatter

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

Definition at line 1780 of file numberformatter.h.

## Constructor & Destructor Documentation

icu::number::LocalizedNumberFormatter::LocalizedNumberFormatter | ( | const LocalizedNumberFormatter & | other | ) |
| inline

Returns a copy of this LocalizedNumberFormatter.

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

Definition at line 1830 of file numberformatter.h.

icu::number::LocalizedNumberFormatter::~LocalizedNumberFormatter | ( |  | ) |

Destruct this LocalizedNumberFormatter, cleaning up any memory it might own.

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

## Member Function Documentation

FormattedNumber icu::number::LocalizedNumberFormatter::formatDecimal | ( | StringPiece | value,
|  | UErrorCode & | status
| ) |  | const

Format the given decimal number to a string using the settings specified in the NumberFormatter fluent setting chain.

The syntax of the unformatted number is a "numeric string" as defined in the Decimal Arithmetic Specification, available at http://speleotrove.com/decimal

Parameters

  value | The number to format.
  status | Set to an ErrorCode if one occurred in the setter chain or during formatting.

Returns
  A FormattedNumber object; call .toString() to get the string.

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

FormattedNumber icu::number::LocalizedNumberFormatter::formatDouble | ( | double | value,
|  | UErrorCode & | status
| ) |  | const

Format the given float or double to a string using the settings specified in the NumberFormatter fluent setting chain.

Parameters

  value | The number to format.
  status | Set to an ErrorCode if one occurred in the setter chain or during formatting.

Returns
  A FormattedNumber object; call .toString() to get the string.

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

FormattedNumber icu::number::LocalizedNumberFormatter::formatInt | ( | int64_t | value,
|  | UErrorCode & | status
| ) |  | const

Format the given integer number to a string using the settings specified in the NumberFormatter fluent setting chain.

Parameters

  value | The number to format.
  status | Set to an ErrorCode if one occurred in the setter chain or during formatting.

Returns
  A FormattedNumber object; call .toString() to get the string.

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:

- numberformatter.h