Here you can find the source of timeFormat(final long milliseconds)
Parameter | Description |
---|---|
milliseconds | a parameter |
public static String timeFormat(final long milliseconds)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; import java.text.NumberFormat; public class Main { /**/*from w ww .j av a2s . co m*/ * Converts into seconds and returns a string in the format * {@code <seconds>.<milliseconds>}. * * @param milliseconds * @return String */ public static String timeFormat(final long milliseconds) { double seconds = milliseconds / 1000.0d; final NumberFormat fmt = new DecimalFormat("#0.000"); return fmt.format(seconds); } }