Calculates the percentage of a value relative to a maximum.
percentage(50, 200); // 25percentage(0, 100); // 0percentage(100, 0); // 0 (avoids division by zero)percentage(75, 300); // 25percentage(null, 100); // undefinedpercentage(50, null); // undefined Copy
percentage(50, 200); // 25percentage(0, 100); // 0percentage(100, 0); // 0 (avoids division by zero)percentage(75, 300); // 25percentage(null, 100); // undefinedpercentage(50, null); // undefined
Calculates the percentage of a value relative to a maximum.