calculatePercentage static method
Calculate percentage
value - The value
total - The total
Returns percentage
Implementation
static double calculatePercentage(double value, double total) {
if (total == 0) return 0;
return (value / total) * 100;
}