"Fossies" - the Fresh Open Source Software Archive

Member "classicu_1_1number_1_1IntegerWidth.html" (3 Oct 2019, 11586 Bytes) of package /linux/misc/icu4c-65_1-docs.zip:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the project site itself.

ICU 65.1  65.1
Public Member Functions | Static Public Member Functions | Friends
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. More...
 

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. More...
 

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.

Stable:
ICU 60
See also
NumberFormatter

Definition at line 908 of file numberformatter.h.

Member Function Documentation

◆ truncateAt()

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
maxIntThe maximum number of places before the decimal separator. maxInt == -1 means no truncation.
Returns
An IntegerWidth for passing to the NumberFormatter integerWidth() setter.
Stable:
ICU 60

◆ zeroFillTo()

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
minIntThe minimum number of places before the decimal separator.
Returns
An IntegerWidth for chaining or passing to the NumberFormatter integerWidth() setter.
Stable:
ICU 60

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