Here you can find the source of getPercentWidth(int iColspan, int iMaxTd)
public static String getPercentWidth(int iColspan, int iMaxTd)
//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*/ }