Class DoubleFormat.MixedDoubleFormat
java.lang.Object
org.apache.commons.text.numbers.DoubleFormat.AbstractDoubleFormat
org.apache.commons.text.numbers.DoubleFormat.MixedDoubleFormat
- All Implemented Interfaces:
DoubleFunction<String>, ParsedDecimal.FormatOptions
- Enclosing class:
DoubleFormat
Format class producing results similar to
Double.toString(), with plain decimal notation for small numbers relatively close to zero and
scientific notation otherwise.- Since:
- 1.10.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intMax decimal exponent for plain format.private final intMin decimal exponent for plain format. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns a formatted representation of the given rounded decimal value todst.
-
Field Details
-
plainMaxExponent
private final int plainMaxExponentMax decimal exponent for plain format. -
plainMinExponent
private final int plainMinExponentMin decimal exponent for plain format.
-
-
Constructor Details
-
MixedDoubleFormat
MixedDoubleFormat(DoubleFormat.Builder builder) Constructs a new instance.- Parameters:
builder- builder instance containing configuration values
-
-
Method Details
-
applyFiniteInternal
Returns a formatted representation of the given rounded decimal value todst.- Specified by:
applyFiniteInternalin classDoubleFormat.AbstractDoubleFormat- Parameters:
val- value to format.- Returns:
- a formatted representation of the given rounded decimal value to
dst.
-