Hi All,

Is there any way to dynamically format the decimal Number(double) without rounding in java. For Example i will pass a double value and numberof decimal places it has to format the value using comma seperated values.

public static String formatNumber(double number,int decimalPlaces)
{
java.text.DecimalFormat threeDecimalFormatter = new java.text.DecimalFormat("###,###,###,##0.000"); //using three decimal it can vary based on decimalPlaces

threeDecimalFormatter.format(number);

}

Please note that it should not round the value call of

roundNumber(123.4567,3) should return 123.456

Regards
Felix