Search:

Type: Posts; User: javaBoi

Search: Search took 0.07 seconds.

  1. Re: Java Program - Distance Traveled (Formatting and Decimal Place)

    #2, I want to know the other way of decimal fomatting. Still a bit confused by it.
  2. Re: Java Program - Distance Traveled (Formatting and Decimal Place)

    Thanks for the reply.

    I just typcasted the double into int (seems to work).

    But, can you give me a sample of how your approach will work, too?
  3. Re: Java Program - Distance Traveled (Formatting and Decimal Place)

    Okay, I was able to fix Issue #1.

    Just had to add some padding to "%d".

    Still can't figure out getting rid of the decimal places for the 80 and 120. I have "import java.text.DecimalFormat;" on...
  4. Java Program - Distance Traveled (Formatting and Decimal Place)

    Hi,

    I'm having trouble formatting my output and issues with the decimal places. Here's my code:


    import java.util.Scanner;
    import java.text.DecimalFormat; // Imports DecimalFormat class for...
Results 1 to 4 of 4