Java Second Format formatSeconds(final int total)

Here you can find the source of formatSeconds(final int total)

Description

format Seconds

License

Open Source License

Declaration

public static String formatSeconds(final int total) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String formatSeconds(final int total) {
        final int minutes = (total / 60);
        final int seconds = (total % 60);
        String secs = Integer.toString(seconds);
        if (seconds < 10) {
            secs = "0" + seconds;
        }/*w  ww  . j  av  a2 s. c  o m*/
        final String time = minutes + ":" + secs;
        return time;
    }
}

Related

  1. formatSecondFractions(long numUnits, int denominator)
  2. formatSeconds(double seconds)
  3. formatSeconds(double seconds)
  4. formatSeconds(double seconds, int precision)
  5. formatSeconds(double value)
  6. formatSeconds(int seconds)
  7. formatSeconds(int seconds)
  8. formatSeconds(long dSeconds, boolean exact)
  9. formatSeconds(long millis)