Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: number formatter in java

  1. #1
    Junior Member
    Join Date
    Jul 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default number formatter in java

    Hi,

    Can anybody help me out in formatting a number in indian currency.
    For Example i want to display 123000000.34 like 12,30,00,000.34.
    I tried with avaiable examples in the net, but the amount is displaying like 123,000,000.34
    I tried with my code but summing the amounts by using double variable I am getting the amount as 1.2E10.When I pass 1.2E10 to the function which I write it is diplaying only 1.

    When I sum the amounts using long variable, decimals are not displaying. Please help me out in solving the issue.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: number formatter in java

    Can you Show your code for doing the formatting?

    Did you read the API doc for the class you are using?
    I found this in the doc:
    The grouping separator is commonly used for thousands, but in some countries it separates ten-thousands.

  3. #3
    Forum old-timer
    Join Date
    Nov 2008
    Location
    Faversham, Kent, UK
    Posts
    472
    My Mood
    Mellow
    Thanks
    4
    Thanked 58 Times in 54 Posts

    Default Re: number formatter in java

    Are you using NumberFormatter? Are you using the correct NumberFormat for the locale?

    If you post the relevant code, perhaps we might be able to make some helpful suggestions.

Similar Threads

  1. How to returned random number to original number?
    By i4ba1 in forum Algorithms & Recursion
    Replies: 2
    Last Post: March 19th, 2011, 04:35 AM
  2. Quick Java Number pad problems
    By SkippyTHEpimp in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 8th, 2011, 06:00 AM
  3. Number Array
    By TheJavaGuy in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 17th, 2011, 04:59 AM
  4. Java Dos Logic Test count all non increasing number
    By Jhovarie in forum Object Oriented Programming
    Replies: 3
    Last Post: January 13th, 2011, 03:28 PM
  5. [SOLVED] How to string a decimal number in Java?
    By Lizard in forum Loops & Control Statements
    Replies: 6
    Last Post: May 14th, 2009, 03:59 PM