An abstract base class for specifying settings related to number formatting.
More...
#include <numberrangeformatter.h>
|
class | LocalizedNumberRangeFormatter |
|
class | UnlocalizedNumberRangeFormatter |
|
template<typename Derived>
class icu::number::NumberRangeFormatterSettings< Derived >
An abstract base class for specifying settings related to number formatting.
This class is implemented by UnlocalizedNumberRangeFormatter and LocalizedNumberRangeFormatter. This class is not intended for public subclassing.
Definition at line 245 of file numberrangeformatter.h.
◆ clone() [1/2]
template<typename Derived>
Returns the current (Un)LocalizedNumberRangeFormatter as a LocalPointer wrapping a heap-allocated copy of the current object.
This is equivalent to new-ing the move constructor with a value object as the argument.
- Returns
- A wrapped (Un)LocalizedNumberRangeFormatter pointer, or a wrapped nullptr on failure.
- Draft:
- This API may be changed in the future versions and was introduced in ICU 64
◆ clone() [2/2]
template<typename Derived>
Overload of clone for use on an rvalue reference.
- Returns
- A wrapped (Un)LocalizedNumberRangeFormatter pointer, or a wrapped nullptr on failure.
- Draft:
- This API may be changed in the future versions and was introduced in ICU 64
◆ collapse() [1/2]
template<typename Derived>
Sets the aggressiveness of "collapsing" fields across the range separator.
Possible values:
-
ALL: "3-5K miles"
-
UNIT: "3K - 5K miles"
-
NONE: "3K miles - 5K miles"
-
AUTO: usually UNIT or NONE, depending on the locale and formatter settings
The default value is AUTO.
- Parameters
-
collapse | The collapsing strategy to use for this range. |
- Returns
- The fluent chain.
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ collapse() [2/2]
template<typename Derived>
Overload of collapse() for use on an rvalue reference.
- Parameters
-
collapse | The collapsing strategy to use for this range. |
- Returns
- The fluent chain.
- See also
- collapse
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ copyErrorTo()
template<typename Derived>
Sets the UErrorCode if an error occurred in the fluent chain.
Preserves older error codes in the outErrorCode.
- Returns
- TRUE if U_FAILURE(outErrorCode)
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
Definition at line 477 of file numberrangeformatter.h.
◆ identityFallback() [1/2]
template<typename Derived>
Sets the behavior when the two sides of the range are the same.
This could happen if the same two numbers are passed to the formatRange function, or if different numbers are passed to the function but they become the same after rounding rules are applied. Possible values:
-
SINGLE_VALUE: "5 miles"
-
APPROXIMATELY_OR_SINGLE_VALUE: "~5 miles" or "5 miles", depending on whether the number was the same before rounding was applied
-
APPROXIMATELY: "~5 miles"
-
RANGE: "5-5 miles" (with collapse=UNIT)
The default value is APPROXIMATELY.
- Parameters
-
identityFallback | The strategy to use when formatting two numbers that end up being the same. |
- Returns
- The fluent chain.
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ identityFallback() [2/2]
template<typename Derived>
Overload of identityFallback() for use on an rvalue reference.
- Parameters
-
identityFallback | The strategy to use when formatting two numbers that end up being the same. |
- Returns
- The fluent chain.
- See also
- identityFallback
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ numberFormatterBoth() [1/4]
template<typename Derived>
Sets the NumberFormatter instance to use for the numbers in the range.
The same formatter is applied to both sides of the range.
The NumberFormatter instances must not have a locale applied yet; the locale specified on the NumberRangeFormatter will be used.
- Parameters
-
formatter | The formatter to use for both numbers in the range. |
- Returns
- The fluent chain.
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ numberFormatterBoth() [2/4]
template<typename Derived>
Overload of numberFormatterBoth() for use on an rvalue reference.
- Parameters
-
formatter | The formatter to use for both numbers in the range. |
- Returns
- The fluent chain.
- See also
- numberFormatterBoth
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ numberFormatterBoth() [3/4]
template<typename Derived>
Overload of numberFormatterBoth() for use on an rvalue reference.
- Parameters
-
formatter | The formatter to use for both numbers in the range. |
- Returns
- The fluent chain.
- See also
- numberFormatterBoth
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ numberFormatterBoth() [4/4]
template<typename Derived>
Overload of numberFormatterBoth() for use on an rvalue reference.
- Parameters
-
formatter | The formatter to use for both numbers in the range. |
- Returns
- The fluent chain.
- See also
- numberFormatterBoth
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ numberFormatterFirst() [1/4]
template<typename Derived>
Sets the NumberFormatter instance to use for the first number in the range.
The NumberFormatter instances must not have a locale applied yet; the locale specified on the NumberRangeFormatter will be used.
- Parameters
-
formatterFirst | The formatter to use for the first number in the range. |
- Returns
- The fluent chain.
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ numberFormatterFirst() [2/4]
template<typename Derived>
Overload of numberFormatterFirst() for use on an rvalue reference.
- Parameters
-
formatterFirst | The formatter to use for the first number in the range. |
- Returns
- The fluent chain.
- See also
- numberFormatterFirst
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ numberFormatterFirst() [3/4]
template<typename Derived>
Overload of numberFormatterFirst() for use on an rvalue reference.
- Parameters
-
formatterFirst | The formatter to use for the first number in the range. |
- Returns
- The fluent chain.
- See also
- numberFormatterFirst
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ numberFormatterFirst() [4/4]
template<typename Derived>
Overload of numberFormatterFirst() for use on an rvalue reference.
- Parameters
-
formatterFirst | The formatter to use for the first number in the range. |
- Returns
- The fluent chain.
- See also
- numberFormatterFirst
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ numberFormatterSecond() [1/4]
template<typename Derived>
Sets the NumberFormatter instance to use for the second number in the range.
The NumberFormatter instances must not have a locale applied yet; the locale specified on the NumberRangeFormatter will be used.
- Parameters
-
formatterSecond | The formatter to use for the second number in the range. |
- Returns
- The fluent chain.
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ numberFormatterSecond() [2/4]
template<typename Derived>
Overload of numberFormatterSecond() for use on an rvalue reference.
- Parameters
-
formatterSecond | The formatter to use for the second number in the range. |
- Returns
- The fluent chain.
- See also
- numberFormatterSecond
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ numberFormatterSecond() [3/4]
template<typename Derived>
Overload of numberFormatterSecond() for use on an rvalue reference.
- Parameters
-
formatterSecond | The formatter to use for the second number in the range. |
- Returns
- The fluent chain.
- See also
- numberFormatterSecond
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
◆ numberFormatterSecond() [4/4]
template<typename Derived>
Overload of numberFormatterSecond() for use on an rvalue reference.
- Parameters
-
formatterSecond | The formatter to use for the second number in the range. |
- Returns
- The fluent chain.
- See also
- numberFormatterSecond
- Draft:
- This API may be changed in the future versions and was introduced in ICU 63
The documentation for this class was generated from the following file: