public final class NumberUtils
extends java.lang.Object
Constructor and Description |
---|
NumberUtils()
Constructor method for i18n purposes only.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
formatNumber(java.lang.Object value,
java.util.Locale locale,
java.lang.String pattern,
java.lang.String fallback)
Gets a locale specific number text from a (database) object (Double, Float, BigDecimal, Integer, Long, Short).
|
static double |
parseDouble(java.lang.Object value,
double fallback)
Gets a double value from a (database) object (Double, BigDecimal, String, ...).
|
static double |
parseDouble(java.lang.String value,
java.util.Locale locale,
java.lang.String pattern,
double fallback)
Gets a locale specific double value from a text.
|
static float |
parseFloat(java.lang.String value,
java.util.Locale locale,
java.lang.String pattern,
float fallback)
Gets a locale specific float value from a text.
|
static int |
parseInt(java.lang.Object value,
int fallback)
Gets an integer value from a (database) object (Integer, String, ...).
|
static int |
parseInt(java.lang.String value,
java.util.Locale locale,
java.lang.String pattern,
int fallback)
Gets a locale specific integer value from a text.
|
public NumberUtils() throws java.lang.InstantiationException
I18NExtractor
).
java.lang.InstantiationException
- Error indicationpublic static int parseInt(java.lang.Object value, int fallback)
value
- Numeric valuefallback
- Returned if an error occurspublic static double parseDouble(java.lang.Object value, double fallback)
value
- Numeric valuefallback
- Returned if an error occurspublic static java.lang.String formatNumber(java.lang.Object value, java.util.Locale locale, java.lang.String pattern, java.lang.String fallback)
value
- Textual valuelocale
- The localepattern
- The formatting pattern, see DecimalFormat
classfallback
- Returned if an error occurspublic static int parseInt(java.lang.String value, java.util.Locale locale, java.lang.String pattern, int fallback)
value
- Textual valuelocale
- The localepattern
- The formatting pattern, see DecimalFormat
classfallback
- Returned if an error occurspublic static double parseDouble(java.lang.String value, java.util.Locale locale, java.lang.String pattern, double fallback)
value
- Textual valuelocale
- The localepattern
- The formatting pattern, see DecimalFormat
classfallback
- Returned if an error occurspublic static float parseFloat(java.lang.String value, java.util.Locale locale, java.lang.String pattern, float fallback)
value
- Textual valuelocale
- The localepattern
- The formatting pattern, see DecimalFormat
classfallback
- Returned if an error occursCopyright © 2005-2023 Leisenfels GmbH. All rights reserved.