Java Percentage Format formatTimePercent(long part, long tot)

Here you can find the source of formatTimePercent(long part, long tot)

Description

format Time Percent

License

Open Source License

Declaration

public static String formatTimePercent(long part, long tot) 

Method Source Code

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

Related

  1. formatPercentage(double perc)
  2. formatPercentage(Double percentage)
  3. formatPercentage(double percentage)
  4. formatPercentage(double percentage)
  5. formatPercentage(int enumerator, int denominator)
  6. getIntRoundPercent(double f)
  7. getOneDecimalPercentFromDouble(double inValue)
  8. getPercentage(double number)
  9. getPercentage(double number, int fractionDigits)