icu::number::IntegerWidth Class Reference

A class that defines the strategy for padding and truncating integers before the decimal separator. More...

#include <numberformatter.h>

Inheritance diagram for icu::number::IntegerWidth:
icu::UMemory

Public Member Functions

IntegerWidth truncateAt (int32_t maxInt)
 Truncate numbers exceeding a certain number of numerals before the decimal separator.

Static Public Member Functions

static IntegerWidth zeroFillTo (int32_t minInt)
 Pad numbers at the beginning with zeros to guarantee a certain number of numerals before the decimal separator.

Friends

struct impl::MacroProps
struct impl::MicroProps
class impl::NumberFormatterImpl
class impl::NumberPropertyMapper
class impl::GeneratorHelpers

Detailed Description

A class that defines the strategy for padding and truncating integers before the decimal separator.

To create an IntegerWidth, use one of the factory methods.

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

Definition at line 954 of file numberformatter.h.


Member Function Documentation

IntegerWidth icu::number::IntegerWidth::truncateAt ( int32_t  maxInt  ) 

Truncate numbers exceeding a certain number of numerals before the decimal separator.

For example, with maxInt=3, the number 1234 will get printed as "234".

Parameters:
maxInt The maximum number of places before the decimal separator. maxInt == -1 means no truncation.
Returns:
An IntegerWidth for passing to the NumberFormatter integerWidth() setter.
Draft:
This API may be changed in the future versions and was introduced in ICU 60
static IntegerWidth icu::number::IntegerWidth::zeroFillTo ( int32_t  minInt  )  [static]

Pad numbers at the beginning with zeros to guarantee a certain number of numerals before the decimal separator.

For example, with minInt=3, the number 55 will get printed as "055".

Parameters:
minInt The minimum number of places before the decimal separator.
Returns:
An IntegerWidth for chaining or passing to the NumberFormatter integerWidth() 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