List of utility methods to do BigDecimal Format
int | fmtBdToInt(BigDecimal bd) fmt Bd To Int if (bd == null) return 0; return bd.intValue(); |
String | format(BigDecimal amount, String format) format if (amount == null) { amount = BigDecimal.ZERO; DecimalFormat decimalFormat = new DecimalFormat(); Locale lcl = Locale.FRENCH; decimalFormat = (DecimalFormat) DecimalFormat.getInstance(lcl); decimalFormat.applyPattern(format); String value = decimalFormat.format(amount); ... |
String | format(BigDecimal decData, int precision, int scale) Format. decData = decData.setScale(scale, BigDecimal.ROUND_HALF_EVEN); String strData = decData.toString(); int finalLen = precision + 1; String finalStr; if (finalLen <= strData.length()) { finalStr = strData.substring(0, finalLen); } else { finalStr = ""; ... |
String | format(BigDecimal decimal) format DecimalFormat df = new DecimalFormat("#,###.##"); return df.format(decimal); |
BigDecimal | format(BigDecimal n, int prec) Returns the BigDecimal value n with exactly 'prec' decimal places. return n.setScale(prec, BigDecimal.ROUND_HALF_UP);
|
BigDecimal | format(BigDecimal n, int prec) format return n.setScale(prec, DEFAULT_ROUNDING_MODE);
|
String | format(BigDecimal no, String formatter) format DecimalFormat df = new DecimalFormat(formatter); return df.format(no); |
String | format(BigDecimal num) format java.text.DecimalFormat df = new java.text.DecimalFormat("0.00"); return df.format(num); |
String | format(BigDecimal num) format NumberFormat nf = NumberFormat.getInstance(); nf.setMaximumFractionDigits(100); nf.setMinimumFractionDigits(0); nf.setGroupingUsed(false); return nf.format(num).replace(",", "."); |
String | format(BigDecimal num) format String result = ""; try { result = format(num.doubleValue()); } catch (Exception e) { return result; |