Class DoubleFormat
- java.lang.Object
-
- io.micrometer.core.instrument.util.DoubleFormat
-
public final class DoubleFormat extends java.lang.Object
Commonly used formatting of floating-point values used when writing custom exposition to various monitoring systems.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.lang.String
decimal(double d)
static java.lang.String
decimalOrNan(double d)
static java.lang.String
decimalOrWhole(double d)
Deprecated.since 1.0.11 in favour ofwholeOrDecimal(double)
static java.lang.String
wholeOrDecimal(double d)
-
-
-
Method Detail
-
decimalOrNan
public static java.lang.String decimalOrNan(double d)
- Parameters:
d
- Number to format.- Returns:
- A stringified version of the number that uses a decimal representation or the word "NaN".
-
decimalOrWhole
@Deprecated public static java.lang.String decimalOrWhole(double d)
Deprecated.since 1.0.11 in favour ofwholeOrDecimal(double)
- Parameters:
d
- Number to format.- Returns:
- A stringified version of the number that only uses a decimal representation if the number is not whole.
-
decimal
public static java.lang.String decimal(double d)
- Parameters:
d
- Number to format.- Returns:
- A stringified version of the number that only uses a decimal representation if the number is not whole.
-
wholeOrDecimal
public static java.lang.String wholeOrDecimal(double d)
- Parameters:
d
- Number to format.- Returns:
- A stringified version of the number that only uses a decimal representation if the number is not whole.
-
-