icu::number::ScientificNotation Class Reference

A class that defines the scientific notation style to be used when formatting numbers in NumberFormatter. More...

#include <numberformatter.h>

Inheritance diagram for icu::number::ScientificNotation:
icu::number::Notation icu::UMemory

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

Detailed Description

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.

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

Definition at line 521 of file numberformatter.h.


Member Function Documentation

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

Parameters:
exponentSignDisplay The strategy for displaying the sign in the exponent.
Returns:
A ScientificNotation, for chaining.
Draft:
This API may be changed in the future versions and was introduced in ICU 60
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".

Parameters:
minExponentDigits The minimum number of digits to show in the exponent.
Returns:
A ScientificNotation, for chaining.
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 15 Dec 2017 for ICU 60.1 by  doxygen 1.6.1