List of utility methods to do BigDecimal Format
String | formatAsReadable(BigDecimal number) Formats the given BigDecimal to a readable String. return humanReadableFormat.format(number);
|
String | formatBetrag(BigDecimal bdBetrag, Locale locale) Einen Betrag localeabhaengig formatieren. return NumberFormat.getCurrencyInstance(locale).format(bdBetrag.doubleValue());
|
String | formatBigDecimal(BigDecimal bd, NumberFormat format) Formatteert bd volgens format. if (bd == null) { return ""; } else { return format.format(bd.doubleValue()); |
String | formatBigDecimal(BigDecimal bigDecimal) Formats a BigDecimal to a String according to JVM Locale. DecimalFormatSymbols dfs = new DecimalFormatSymbols(Locale.getDefault()); String result = String.valueOf(bigDecimal.doubleValue()); result = result.replace('.', dfs.getDecimalSeparator()); return result; |
String | formatBigDecimal(BigDecimal bigDecimal, int scale) Formate un big decimal if (scale != formaterScale) initializeDecimalFormat(scale); return decimalFormater.format(bigDecimal.doubleValue()); |
String | formatBigDecimal(BigDecimal d) Method for adding trailing zeroes for a BigDecimal value DecimalFormat df = new DecimalFormat("#.##"); df.setMinimumFractionDigits(2); return df.format(d); |
BigDecimal | formatBigDecimal(BigDecimal n, int dp) Sets [n] to [dp] decimal places. return n.setScale(dp, BigDecimal.ROUND_HALF_UP);
|
String | formatBigDecimal(BigDecimal number, int val) format Big Decimal DecimalFormat nf = new DecimalFormat(); nf.setMaximumFractionDigits(val); nf.setMinimumFractionDigits(val); nf.setRoundingMode(RoundingMode.HALF_UP); nf.setGroupingUsed(true); return nf.format(number); |
String | formatBigDecimal(BigDecimal valor, int decimal) Formata um Big Decimal if (valor == null) { return null; NumberFormat format = NumberFormat.getInstance(new Locale("pt", "BR")); format.setMaximumFractionDigits(decimal); format.setMinimumFractionDigits(decimal); return format.format(valor); |
String | formatBigDecimal(BigDecimal value, char thousandSep, char decimalPoint, int numDecimals) Format a BigDecimal, grouping thousands and rounding to a specified number of decimal digits. if (numDecimals >= 0 && value.scale() != numDecimals) { value = value.setScale(numDecimals, BigDecimal.ROUND_HALF_UP); String stringValue = value.toString(); int origLen = stringValue.length(); int decPoint = stringValue.indexOf('.'); int thousandSepCount; boolean hasDecPoint; ... |