Interface INumberFormat
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
NumberFormat
This format class formats numbers according to the implementations specifications. Regardless of whether the number
is an integer or a floating point.
Since java and .NET behave quite differently this has a specific pattern parser similar to the Java's DecimalFormat
but with reduced functionality regarding to currency and percentages.
The most used class NumberFormat has support for 'functions'.
- Since:
- 6.0
- Author:
- F. van der Meer
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionformat
(double number) Formats an integer number to it's string representation.format
(long number) Formats an integer number to it's string representation.double
This method parses an input text and returns the corresponding number value.long
parseInteger
(String text) This method parses an input text and returns the corresponding number value.
-
Method Details
-
format
Formats an integer number to it's string representation. The implementor of this interface should be able to parse string that is returned as well.- Parameters:
number
- The number to format.- Returns:
- The string representation of this number which should never be null
-
format
Formats an integer number to it's string representation. The implementor of this interface should be able to parse the string that was returned as well.- Parameters:
number
- The number to format.- Returns:
- The string representation of this number which should never be null
-
parse
This method parses an input text and returns the corresponding number value. The complete text should be a number during parse. If the parse fails an- Parameters:
text
- The text to parse, which should never be a null pointer.- Returns:
- The double value parsed from the text.
- Throws:
ParseException
- When the text could not be parsed to a number.
-
parseInteger
This method parses an input text and returns the corresponding number value. The complete text should be a number during parse. If the parse fails an- Parameters:
text
- The text to parse, which should never be a null pointer.- Returns:
- The double value parsed from the text.
- Throws:
ParseException
- When the text could not be parsed to a number.
-