public class DecimalUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
trimInsignificantZeros(java.lang.String floatingPointNumber)
Removes trailing zeros after the decimal dot and also the dot itself if there are no non-zero
digits after it.
|
static java.lang.String |
trimInsignificantZeros(java.lang.String floatingPointNumber,
char decimalSeparator,
java.lang.String exponentialSeparator)
Removes trailing zeros after the decimal separator and also the decimal separator itself if
there are no non-zero digits after it.
|
static java.lang.String |
trimInsignificantZeros(java.lang.String floatingPointNumber,
java.text.DecimalFormatSymbols symbols)
Removes trailing zeros after the decimal separator and also the decimal separator itself if
there are no non-zero digits after it.
|
@NonNull
public static java.lang.String trimInsignificantZeros(@NonNull
java.lang.String floatingPointNumber)
trimInsignificantZeros(String, DecimalFormatSymbols) instead of
this method if locale specific behavior is desired.floatingPointNumber - the string representing a floating point numberpublic static java.lang.String trimInsignificantZeros(@NonNull
java.lang.String floatingPointNumber,
@NonNull
java.text.DecimalFormatSymbols symbols)
floatingPointNumber - the string representing a floating point numbersymbols - the decimal format symbolspublic static java.lang.String trimInsignificantZeros(@NonNull
java.lang.String floatingPointNumber,
char decimalSeparator,
java.lang.String exponentialSeparator)
floatingPointNumber - the string representing a floating point numberdecimalSeparator - the decimal separatorexponentialSeparator - the string used to separate the mantissa from the exponent