commas with decimals in amounts

                 String x="24668124.00";
                  DecimalFormat df = new DecimalFormat("#,###,###.##");
                  System.out.println(df.format(Double.parseDouble(x)));

                  when i print this value 24,668,124 is coming but i want with decimals like this24,668,124.00 ;
LVL 20
chaitu chaituAsked:
Who is Participating?
 
TimYatesCommented:
# means put a number there if there is one

0 means put a number there if there is one, or "0" if there isn't
0
 
TimYatesCommented:
DecimalFormat df = new DecimalFormat("#,###,###.00");
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.