Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Re: Java Change Maker need help with rounding up the pennies

    Convert dollars in double to cents in int:

    int val = (int)(doubleVal*100);
  2. Re: Java Change Maker need help with rounding up the pennies

    Convert each of the variables contents to cents in an int variable BEFORE subtracting.
  3. Re: Java Change Maker need help with rounding up the pennies

    That does the multiply and cast AFTER the subtraction. Do it BEFORE any math operations.

    Print out the value of change from that expression to see.
  4. Re: Java Change Maker need help with rounding up the pennies

    Convert the contents of these to cents BEFORE doing any math: tendered and spent
  5. Re: Java Change Maker need help with rounding up the pennies

    Did you see this:
    Convert the amounts to cents before doing any math with them.
  6. Re: Java Change Maker need help with rounding up the pennies

    Can you copy the contents of the console window and paste it here that shows the problem?

    Convert the amounts to cents before doing any math with them.

    On Windows: To copy the contents of the...
Results 1 to 6 of 6