I have a BigDecimal number and i consider only 2 decimal places of it so i truncate it using:
bd = bd.setScale(2, BigDecimal.ROUND_DOWN)
No
The below code may help you.
protected String getLocalizedBigDecimalValue(BigDecimal input, Locale locale) {
final NumberFormat numberFormat = NumberFormat.getNumberInstance(locale);
numberFormat.setGroupingUsed(true);
numberFormat.setMaximumFractionDigits(2);
numberFormat.setMinimumFractionDigits(2);
return numberFormat.format(input);
}