Here you can find the source of doubleToTime(double time)
Parameter | Description |
---|---|
time | Double time |
public static String doubleToTime(double time)
//package com.java2s; //License from project: Apache License public class Main { /**//from w ww . j a v a 2 s. co m * Convert double time to string. * * @param time Double time * @return String to show on screen */ public static String doubleToTime(double time) { int ms = (int) (time * 1000 % 1000); int s = (int) (time % 60); int min = (int) (time / 60); return min + ":" + String.format("%02d", s) + ":" + String.format("%03d", ms); } }