commas with decimals in amounts

Posted on 2007-10-04
Last Modified: 2010-03-30
                 String x="24668124.00";
                  DecimalFormat df = new DecimalFormat("#,###,###.##");

                  when i print this value 24,668,124 is coming but i want with decimals like this24,668,124.00 ;
Question by:chaitu chaitu
    LVL 35

    Expert Comment

    DecimalFormat df = new DecimalFormat("#,###,###.00");
    LVL 35

    Accepted Solution

    # 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

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Suggested Solutions

    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now