Movatterモバイル変換


[0]ホーム

URL:


ICU 78.2  78.2
Data Structures |Static Public Member Functions |Friends
icu::number::Notation Class Reference

A class that defines the notation style to be used when formatting numbers inNumberFormatter.More...

#include <numberformatter.h>

Inheritance diagram for icu::number::Notation:

Static Public Member Functions

staticScientificNotation scientific ()
 Print the number using scientific notation (also known as scientific form, standard index form, or standard form in the UK).More...
 
staticScientificNotation engineering ()
 Print the number using engineering notation, a variant of scientific notation in which the exponent must be divisible by 3.More...
 
staticCompactNotation compactShort ()
 Print the number using short-form compact notation.More...
 
staticCompactNotation compactLong ()
 Print the number using long-form compact notation.More...
 
staticSimpleNotation simple ()
 Print the number using simple notation without any scaling by powers of ten.More...
 

Friends

struct impl::MacroProps
 
class ScientificNotation
 
class impl::NumberFormatterImpl
 
class impl::ScientificModifier
 
class impl::ScientificHandler
 
class impl::GeneratorHelpers
 

Detailed Description

A class that defines the notation style to be used when formatting numbers inNumberFormatter.

Stable:
ICU 60

Definition at line203 of filenumberformatter.h.

Member Function Documentation

◆ compactLong()

staticCompactNotation icu::number::Notation::compactLong()
static

Print the number using long-form compact notation.

For more information on compact notation, seecompactShort.

In long form, the powers of ten are spelled out fully. Example outputs inen-US when printing 8.765E7 through 8.765E0:

88 million8.8 million876 thousand88 thousand8.8 thousand876888.8
Returns
A CompactNotation for passing to theNumberFormatter notation() setter.
Stable:
ICU 60

◆ compactShort()

staticCompactNotation icu::number::Notation::compactShort()
static

Print the number using short-form compact notation.

Compact notation, defined in Unicode Technical Standard #35 Part 3 Section 2.4.1, prints numbers with localized prefixes or suffixes corresponding to different powers of ten. Compact notation is similar to engineering notation in how it scales numbers.

Compact notation is ideal for displaying large numbers (over ~1000) to humans while at the same time minimizing screen real estate.

In short form, the powers of ten are abbreviated. Inen-US, the abbreviations are "K" for thousands, "M" for millions, "B" for billions, and "T" for trillions. Example outputs inen-US when printing 8.765E7 through 8.765E0:

88M8.8M876K88K8.8K876888.8

When compact notation is specified without an explicit rounding precision, numbers are rounded off to the closest integer after scaling the number by the corresponding power of 10, but with a digit shown after the decimal separator if there is only one digit before the decimal separator. The default compact notation rounding precision is equivalent to:

Precision::integer().withMinDigits(2)
Returns
A CompactNotation for passing to theNumberFormatter notation() setter.
Stable:
ICU 60

◆ engineering()

staticScientificNotation icu::number::Notation::engineering()
static

Print the number using engineering notation, a variant of scientific notation in which the exponent must be divisible by 3.

Example outputs inen-US when printing 8.765E4 through 8.765E-3:

87.65E38.765E3876.5E087.65E08.765E0876.5E-387.65E-38.765E-30E0
Returns
AScientificNotation for chaining or passing to theNumberFormatter notation() setter.
Stable:
ICU 60

◆ scientific()

staticScientificNotation icu::number::Notation::scientific()
static

Print the number using scientific notation (also known as scientific form, standard index form, or standard form in the UK).

The format for scientific notation varies by locale; for example, many Western locales display the number in the form "#E0", where the number is displayed with one digit before the decimal separator, zero or more digits after the decimal separator, and the corresponding power of 10 displayed after the "E".

Example outputs inen-US when printing 8.765E4 through 8.765E-3:

8.765E48.765E38.765E28.765E18.765E08.765E-18.765E-28.765E-30E0
Returns
AScientificNotation for chaining or passing to theNumberFormatter notation() setter.
Stable:
ICU 60

◆ simple()

staticSimpleNotation icu::number::Notation::simple()
static

Print the number using simple notation without any scaling by powers of ten.

This is the default behavior.

Since this is the default behavior, this method needs to be called only when it is necessary to override a previous setting.

Example outputs inen-US when printing 8.765E7 through 8.765E0:

87,650,0008,765,000876,50087,6508,765876.587.658.765
Returns
A SimpleNotation for passing to theNumberFormatter notation() setter.
Stable:
ICU 60

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

Generated by doxygen 1.9.1
[8]ページ先頭

©2009-2026 Movatter.jp