Interface NumberFormatter
- All Known Implementing Classes:
LocaleNumberFormatter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface for formatting numeric values into localized
String
representations.
Implementations of this interface convert Number
instances into strings
based on localization rules, such as digit grouping, decimal separators, and numeric styles
defined by a Locale
.
This interface is used throughout the message building pipeline to ensure numeric values (e.g., coordinates, quantities) are presented in a locale-aware manner within macro-replaced messages.
To provide a concrete implementation, see
LocaleNumberFormatter
.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetFormatted
(Number number) Formats the providedNumber
using a locale-specific format.
-
Method Details
-
getFormatted
Formats the providedNumber
using a locale-specific format.- Parameters:
number
- the numeric value to format- Returns:
- a localized string representation of the number
-