Java Number Percentage Format getPercent(final long downloadCurrent, final long downloadMax)

Here you can find the source of getPercent(final long downloadCurrent, final long downloadMax)

Description

get Percent

License

Open Source License

Declaration

public static String getPercent(final long downloadCurrent,
            final long downloadMax) 

Method Source Code

//package com.java2s;
//    it under the terms of the GNU General Public License as published by

import java.text.DecimalFormat;

public class Main {
    public static String getPercent(final long downloadCurrent,
            final long downloadMax) {
        return (new DecimalFormat("0.00")).format(100.0 * downloadCurrent
                / downloadMax)//from   w  ww.ja  v  a  2  s  . co  m
                + "%";
    }
}

Related

  1. getPercent(Double num)
  2. getPercent(double percent)
  3. getPercent(Double value)
  4. getPercent(long l1, long l2)
  5. getPercent(long val1, long val2)
  6. getPercentFormatter()
  7. getPercentileWithSuffix(double percentile)