Here you can find the source of formatTimePercent(long part, long tot)
public static String formatTimePercent(long part, long tot)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; public class Main { public static String formatTimePercent(long part, long tot) { final double timeRatio = (((double) part) / tot); String timePercent = new DecimalFormat("##.##%").format(timeRatio); return timePercent; }//from w w w. j av a 2 s . co m }