Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2016
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Formatting the time to look like minutes

    hi

    I have a getter

    public int getTime() {
    return time;
    }

    and a setter for the time

    public void setTime(int t) {
    time = t;
    }

    Which one and how do I change them so that
    the proper format for minutes is displayed?

    For example, I have 243
    but what I wan ist 2.43

    Is anyone able to help me?

  2. #2
    New Coder
    Join Date
    Jan 2016
    Location
    Malaysia
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you show us how you get the t ?

  3. #3
    New to the CF scene
    Join Date
    Aug 2016
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I get the t from my constructor:
    public BanffMarathonRunner(String fN, String lN, int t, int y) {
    super(fN, null, lN);
    this.time = t;

  4. #4
    New Coder
    Join Date
    Jan 2016
    Location
    Malaysia
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The code you provided are not enough....


 

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
  •