Java Double to doubleToTime(double time)

Here you can find the source of doubleToTime(double time)

Description

Convert double time to string.

License

Apache License

Parameter

Parameter Description
time Double time

Return

String to show on screen

Declaration

public static String doubleToTime(double time) 

Method Source Code

//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);
    }
}

Related

  1. doubleToScale(double val)
  2. doubleToSexagesimal(double value, int precision, double hopr, double lopr)
  3. doubleToSingleQuote(String source)
  4. doubleToSingleQuotes(String str)
  5. doubleToSlider(final double min, final double max, final double value)
  6. doubleToUnary(int max, double num)