Here you can find the source of milliSecsToTime(double current, double max, double buffer)
public static String milliSecsToTime(double current, double max, double buffer)
//package com.java2s; //License from project: Apache License public class Main { public static String milliSecsToTime(double current, double max, double buffer) { int currentSec = (int) (current / 1000); int maxSec = (int) (max / 1000); int bufPer = Math.min((int) ((buffer * 100) / max), 100); return String.format("%3d:%02d /%3d:%02d [%3d%%]", Integer.valueOf(currentSec / 60), Integer.valueOf(currentSec % 60), Integer.valueOf(maxSec / 60), Integer.valueOf(maxSec % 60), Integer.valueOf(bufPer)); }//from www . j a v a 2s.com }