List of utility methods to do BigDecimal from String
BigDecimal | string2BigDecimal(String aValue) string Big Decimal if (aValue != null && aValue.trim().length() > 0) { return new BigDecimal(aValue); } else { return null; |
BigDecimal | string2BigDecimal(String s) string Big Decimal try { if (s == null || "".equals(s.trim())) { return null; } else { return new BigDecimal(s); } catch (Exception e) { return null; ... |
BigDecimal | string2BigDecimal(String st) Konvertiert einen String in einen BigDecimal-Wert mit zwei Nachkommastellen. BigDecimal result = new BigDecimal(st); result.setScale(2, BigDecimal.ROUND_HALF_EVEN); return result; |
BigDecimal | String2BigDecimal(String str) String Big Decimal return BigDecimal.valueOf(Double.parseDouble(str));
|
BigDecimal | stringToBigDecimal(String numberString) string To Big Decimal BigDecimal BD; Double number = Double.parseDouble(numberString); if (number.doubleValue() == 0.0) { BD = BigDecimal.ZERO; } else { BD = new BigDecimal(number); return BD; ... |
BigDecimal | stringToBigDecimal(String src, int[] endPos) A slightly more tolerant version of the BigDecimal constructor - we allow the valid number to be followed by non-numeric characters at the end of the string. int endIndex = src.length(); while (!Character.isDigit(src.charAt(endIndex - 1))) { endIndex--; BigDecimal value = new BigDecimal(src.substring(0, endIndex)); endPos[0] = endIndex; return value; |
BigDecimal | stringToDec(final CharSequence stringValue, final BigDecimal defaultValue) Converts a string value to its equivalent BigDecimal value. BigDecimal result; try { result = new BigDecimal(stringToNumericAdjust(stringValue, false)); } catch (final Exception e) { result = defaultValue; return result; |