public class ScientificNotation extends Notation
To create a ScientificNotation, use one of the factory methods in Notation
.
NumberFormatter
Modifier and Type | Method and Description |
---|---|
ScientificNotation |
withExponentSignDisplay(NumberFormatter.SignDisplay exponentSignDisplay)
Sets whether to show the sign on positive and negative exponents in scientific notation.
|
ScientificNotation |
withMinExponentDigits(int minExponentDigits)
Sets the minimum number of digits to show in the exponent of scientific notation, padding with
zeros if necessary.
|
compactLong, compactShort, engineering, scientific, simple
public ScientificNotation withMinExponentDigits(int minExponentDigits)
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.IllegalArgumentException
- if minExponentDigits is too big or smaller than 1NumberFormatter
public ScientificNotation withExponentSignDisplay(NumberFormatter.SignDisplay exponentSignDisplay)
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.NumberFormatter
Copyright © 2016 Unicode, Inc. and others.