Package com.helger.commons.locale
Class LocaleParser
java.lang.Object
com.helger.commons.locale.LocaleParser
Helper class to safely parse formatted numbers.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionstatic Numberparse(String sStr, NumberFormat aNF) static Numberparse(String sStr, NumberFormat aNF, Number aDefault) static Numberstatic Numberstatic BigDecimalparseBigDecimal(String sStr, DecimalFormat aNF) static BigDecimalparseBigDecimal(String sStr, DecimalFormat aNF, BigDecimal aDefault) static BigDecimalparseBigDecimal(String sStr, NumberFormat aNF) static BigDecimalparseBigDecimal(String sStr, NumberFormat aNF, BigDecimal aDefault) static BigDecimalparseBigDecimal(String sStr, Locale aParseLocale) static BigDecimalparseBigDecimal(String sStr, Locale aParseLocale, BigDecimal aDefault) static byteparseByte(String sStr, NumberFormat aNF, byte nDefault) static bytestatic doubleparseDouble(String sStr, NumberFormat aNF, double dDefault) static doubleparseDouble(String sStr, Locale aParseLocale, double dDefault) static floatparseFloat(String sStr, NumberFormat aNF, float fDefault) static floatparseFloat(String sStr, Locale aParseLocale, float fDefault) static intparseInt(String sStr, NumberFormat aNF, int nDefault) static intstatic longparseLong(String sStr, NumberFormat aNF, long nDefault) static longstatic shortparseShort(String sStr, NumberFormat aNF, short nDefault) static shortparseShort(String sStr, Locale aParseLocale, short nDefault)
-
Method Details
-
parse
-
parse
-
parse
-
parse
-
parseFloat
-
parseFloat
-
parseDouble
-
parseDouble
-
parseByte
-
parseByte
-
parseInt
-
parseInt
-
parseLong
-
parseLong
-
parseShort
-
parseShort
-
parseBigDecimal
-
parseBigDecimal
@Nullable public static BigDecimal parseBigDecimal(@Nullable String sStr, @Nonnull Locale aParseLocale, @Nullable BigDecimal aDefault) -
parseBigDecimal
@Nullable public static BigDecimal parseBigDecimal(@Nullable String sStr, @Nonnull DecimalFormat aNF) -
parseBigDecimal
@Nullable public static BigDecimal parseBigDecimal(@Nullable String sStr, @Nonnull DecimalFormat aNF, @Nullable BigDecimal aDefault) -
parseBigDecimal
@Nullable public static BigDecimal parseBigDecimal(@Nullable String sStr, @Nonnull NumberFormat aNF) -
parseBigDecimal
@Nullable public static BigDecimal parseBigDecimal(@Nullable String sStr, @Nonnull NumberFormat aNF, @Nullable BigDecimal aDefault)
-