Here you can find the source of formatTime(float seconds)
public static String formatTime(float seconds)
//package com.java2s; //License from project: Open Source License public class Main { public static String formatTime(float seconds) { int s = (int) (seconds % 60); int ms = (int) (seconds % 1 * 100); int m = (int) (seconds / 60); if (m > 0) { return String.format("%d:%d.%d", m, s, ms); }/*from ww w . java2 s.co m*/ return String.format("%d.%d", s, ms); } }