1 2 3 4 5 6 7 8 9 10 11
public double Percent(double value, double max) { return ((value * 100) / max); } public int Percent(int value, int max) { return ((value * 100) / max); } // Either works, but the double method is more precise.