Java Millisecond Format formatMilliseconds(Double milliseconds)

Here you can find the source of formatMilliseconds(Double milliseconds)

Description

Formats milliseconds in m:ss format

License

Open Source License

Parameter

Parameter Description
milliseconds a parameter

Declaration

public static String formatMilliseconds(Double milliseconds) 

Method Source Code

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

public class Main {
    /**//from www .  ja  va2 s.  c o m
     * Formats milliseconds in m:ss format
     * @param milliseconds
     * @return
     */
    public static String formatMilliseconds(Double milliseconds) {
        milliseconds /= 1000;
        return String.format("%01.0f:%02.0f", milliseconds / 60, milliseconds % 60);
    }
}

Related

  1. formatMillis(long timeMillis)
  2. formatMillis(String millisecond, String format)
  3. formatMillisAsNumber(long millis)
  4. formatMillisAsShortHumanReadablePeriod(long millis)
  5. formatMilliseconds (final long ms)
  6. formatMilliseconds(long milliseconds)
  7. formatMilliseconds(long milliseconds)
  8. formatMilliSecondsHumanReadable(long x)
  9. formatMillisecondsToConventional(long duration, int unitCount)