Package me.datafox.dfxengine.text.api
Interface NumberSuffixFormatter
- All Superinterfaces:
Comparable<Handled>
,Handled
- All Known Implementing Classes:
CharDigitSuffixFormatter
,ExponentSuffixFormatter
,NamedSuffixFormatter
A formatter that scales a
BigDecimal
number and assigns it a suffix.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
Data class containing the output of aNumberSuffixFormatter
. -
Method Summary
Modifier and TypeMethodDescriptionformat
(BigDecimal number, TextFactory factory, TextConfiguration configuration) boolean
-
Method Details
-
format
NumberSuffixFormatter.Output format(BigDecimal number, TextFactory factory, TextConfiguration configuration) - Parameters:
number
- number to formatfactory
-TextFactory
for formattingconfiguration
-TextConfiguration
for formatting- Returns:
NumberSuffixFormatter.Output
containing the scaled number and a suffix, or theNumberSuffixFormatter.Output
ofTextFactory.getDefaultNumberSuffixFormatter()
if the number cannot be formatted by this formatter- Throws:
TextConfigurationException
- if theTextConfiguration
is not valid for this formatter
-
isInfinite
boolean isInfinite()- Returns:
true
if this formatter can format anyBigDecimal
number
-