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 2 of 2

Thread: How to use format outpout

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    24
    My Mood
    Stressed
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default How to use format outpout

    Hello,
    I would like to know how to format an output to 2 number after the comma , with this code
    MinutesTF.setText("" + Minutes);
    I taught It was going to be something like
    MinutesTF.setText("%.2f %n" + Minutes);
    But It is not working so can someone please help me ,
    Thanks


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,372
    Thanks
    183
    Thanked 836 Times in 779 Posts
    Blog Entries
    5

    Default Re: How to use format outpout

    I would like to know how to format an output to 2 number after the comma
    2 numbers after acomma, or adecimal place? For decimal place, see the following link:

    http://www.javaprogrammingforums.com...al-places.html

Similar Threads

  1. Help with some code format
    By Highlord in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 9th, 2011, 10:27 PM
  2. date format
    By arunjib in forum Java Theory & Questions
    Replies: 4
    Last Post: March 12th, 2011, 01:42 PM
  3. How to set the format of a udp packet ?
    By Mezzo in forum Java Networking
    Replies: 0
    Last Post: January 19th, 2011, 06:43 PM
  4. Format Problems
    By maximus20895 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 27th, 2010, 10:48 PM
  5. How to format?
    By maximus20895 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 15th, 2010, 02:07 PM