ICU 76.1 76.1
|
A class that defines the scientific notation style to be used when formatting numbers in NumberFormatter. More...
#include <numberformatter.h>
Public Member Functions | |
ScientificNotation | withMinExponentDigits (int32_t minExponentDigits) const |
Sets the minimum number of digits to show in the exponent of scientific notation, padding with zeros if necessary. | |
ScientificNotation | withExponentSignDisplay (UNumberSignDisplay exponentSignDisplay) const |
Sets whether to show the sign on positive and negative exponents in scientific notation. | |
Friends | |
class | Notation |
class | impl::NumberPropertyMapper |
Additional Inherited Members | |
Static Public Member Functions inherited from icu::number::Notation | |
static ScientificNotation | scientific () |
Print the number using scientific notation (also known as scientific form, standard index form, or standard form in the UK). | |
static ScientificNotation | engineering () |
Print the number using engineering notation, a variant of scientific notation in which the exponent must be divisible by 3. | |
static CompactNotation | compactShort () |
Print the number using short-form compact notation. | |
static CompactNotation | compactLong () |
Print the number using long-form compact notation. | |
static SimpleNotation | simple () |
Print the number using simple notation without any scaling by powers of ten. | |
A class that defines the scientific notation style to be used when formatting numbers in NumberFormatter.
To create a ScientificNotation, use one of the factory methods in Notation
.
Definition at line 413 of file numberformatter.h.
ScientificNotation icu::number::ScientificNotation::withExponentSignDisplay | ( | UNumberSignDisplay | exponentSignDisplay | ) | const |
Sets whether to show the sign on positive and negative exponents in scientific notation.
The default is AUTO, showing the minus sign but not the plus sign.
For example, with exponentSignDisplay=ALWAYS, the number 123 will be printed as "1.23E+2" in en-US instead of the default "1.23E2".
exponentSignDisplay | The strategy for displaying the sign in the exponent. |
ScientificNotation icu::number::ScientificNotation::withMinExponentDigits | ( | int32_t | minExponentDigits | ) | const |
Sets the minimum number of digits to show in the exponent of scientific notation, padding with zeros if necessary.
Useful for fixed-width display.
For example, with minExponentDigits=2, the number 123 will be printed as "1.23E02" in en-US instead of the default "1.23E2".
minExponentDigits | The minimum number of digits to show in the exponent. |
Definition at line 456 of file numberformatter.h.
Definition at line 453 of file numberformatter.h.