Java Millisecond Convert millisToString(float millis)

Here you can find the source of millisToString(float millis)

Description

millis To String

License

Open Source License

Declaration

public static String millisToString(float millis) 

Method Source Code

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

public class Main {
    public static String millisToString(float millis) {
        //String timeString;
        int s = (int) millis % 60;
        int m = ((int) ((millis / 60) % 60));

        /*StringBuilder builder = new StringBuilder();
          if (m != 0)//from   w w w  .j av a2 s  .c o m
          {
        builder.append(m).append("m:");
          }
            
          builder.append(s).append("s");
          timeString = builder.toString();
          return timeString;*/
        return (m < 10 ? "0" : "") + m + ":" + (s < 10 ? "0" : "") + s;
    }
}

Related

  1. millisToSeconds(final long millis)
  2. millisToSeconds(long millis)
  3. millisToSeconds(long millis)
  4. millisToSeconds(long millis)
  5. millisToShortDHMS(long duration)
  6. millisToString(long millis)
  7. millisToString(long ms)
  8. millisToString(long t)
  9. millisToStringDouble(double millis)