Here you can find the source of formatTime(double seconds)
public static String formatTime(double seconds)
//package com.java2s; import java.text.DecimalFormat; public class Main { private static DecimalFormat df = new DecimalFormat("#0.00"); public static String formatTime(double seconds) { return df.format(seconds) + " s"; }/*from w w w . jav a 2 s . c o m*/ }