mohitkumar gupta wrote:
i think
System.out.println(nf.format(d) + " ");
should give 987.12345 as the output
since
nf.setMaximumFractionDigits(5);
rounds off "987.123449" to "987.12345"
am i wrong please check
but I don't see d as 987.123449, but rather as 987.123456, and it is being rounded off correctly.