Package org.apache.commons.text.numbers
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.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
Max decimal exponent for plain format.private final int
Min decimal exponent for plain format. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns a formatted representation of the given rounded decimal value todst
.Methods inherited from class org.apache.commons.text.numbers.DoubleFormat.AbstractDoubleFormat
apply, getDecimalSeparator, getDigits, getExponentSeparatorChars, getGroupingSeparator, getMinusSign, isAlwaysIncludeExponent, isGroupThousands, isIncludeFractionPlaceholder, isSignedZero
-
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:
applyFiniteInternal
in classDoubleFormat.AbstractDoubleFormat
- Parameters:
val
- value to format- Returns:
- a formatted representation of the given rounded decimal value to
dst
.
-