Class DoubleFormat
java.lang.Object
io.micrometer.core.instrument.util.DoubleFormat
Commonly used formatting of floating-point values used when writing custom exposition
to various monitoring systems.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
decimal
(double d) static String
decimalOrNan
(double d) static String
decimalOrWhole
(double d) Deprecated.static String
wholeOrDecimal
(double d)
-
Method Details
-
decimalOrNan
- Parameters:
d
- Number to format.- Returns:
- A stringified version of the number that uses a decimal representation or the word "NaN".
-
decimalOrWhole
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
- 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
- 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(double)