Results 1 to 3 of 3
  1. #1
    imanoob is offline Member
    Join Date
    Oct 2013
    Posts
    8
    Rep Power
    0

    Exclamation URGENT! Due in one hour. Please help!

    So I thought my program was perfect until I tried to input "1.15" through this: Math.rint(amount*100)/100;

    It outputs as 1.14

    I don't get it. Other numbers work :( Please help, I don't know why is that.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default Re: URGENT! Due in one hour. Please help!

    No it is not urgent!

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: URGENT! Due in one hour. Please help!

    Java Code:
    double amount = 1.15;
    System.out.println(Math.rint(amount*100)/100);
    Gives 1.15.
    So...
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. 24 hour clock to 12 hour clock project.
    By bs3ac in forum New To Java
    Replies: 4
    Last Post: 01-08-2013, 10:10 AM
  2. Need urgent help. This is due in an hour!
    By tpfaff in forum New To Java
    Replies: 7
    Last Post: 07-30-2010, 07:26 AM
  3. HELP!! Assignment due in one hour!
    By murr0508 in forum New To Java
    Replies: 1
    Last Post: 02-26-2009, 09:31 PM

Tags for this Thread

Posting Permissions

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