Here you can find the source of formatSeconds(long time)
public static String formatSeconds(long time)
//package com.java2s; //License from project: Open Source License public class Main { public static String formatSeconds(long time) { if (time == Long.MAX_VALUE) { return "DNF"; }//from w ww .ja va 2s. c o m String sign = ""; if (time < 0) { sign = "-"; time = -time; } time = (time + 5) / 10; long seconds = time / 100; long centiseconds = time % 100; return sign + seconds + "." + (centiseconds < 10 ? "0" + centiseconds : centiseconds); } }