Java Number Percentage Format getPercentWidth(int iColspan, int iMaxTd)

Here you can find the source of getPercentWidth(int iColspan, int iMaxTd)

Description

get Percent Width

License

Open Source License

Declaration

public static String getPercentWidth(int iColspan, int iMaxTd) 

Method Source Code

//package com.java2s;
import java.text.NumberFormat;

public class Main {

    public static String getPercentWidth(int iColspan, int iMaxTd) {
        double dMin = iColspan * 1.0;
        double dMax = iMaxTd * 1.0;
        double dResult = dMin / dMax;
        NumberFormat objNf = NumberFormat.getPercentInstance();
        objNf.setMinimumFractionDigits(0);
        return objNf.format(dResult);
    }/*from  www.j  a v a2s.  c  om*/
}

Related

  1. getPercentileWithSuffix(double percentile)
  2. getPercentMemUse()
  3. getPercentNumber(double num, int scale)
  4. getPercentString(double numerator, double denominator)
  5. getPercentValue(double value)