Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2010
    Posts
    18
    Rep Power
    0

    Default i want to float the answer

    how do i flot a number to a 2 decimal points?
    for example like this

    1.256454122 X10^2

    to

    1.26 X 10^2????

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Try seeing if System.out.printf(...), or String.format(...) can help you accomplish this.

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    16,582
    Rep Power
    23

Similar Threads

  1. Compare true Answer /Player answer
    By Eilime in forum New To Java
    Replies: 1
    Last Post: 04-24-2011, 08:51 PM
  2. Could anyway answer me this?
    By Jojomofoman in forum New To Java
    Replies: 14
    Last Post: 12-16-2010, 11:14 PM
  3. Replies: 12
    Last Post: 07-27-2010, 09:40 AM
  4. Need help with Java Answer
    By alexisasoxfan in forum New To Java
    Replies: 2
    Last Post: 05-10-2010, 07:17 AM
  5. Plz answer this question ...
    By raghu2114 in forum Advanced Java
    Replies: 2
    Last Post: 09-19-2008, 06:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •