Fix decimal rendering in progress bars (#3849)

This commit is contained in:
Oliver 2022-10-25 10:58:18 +11:00 committed by GitHub
parent d2049a1cd0
commit 2843799912
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,14 +185,14 @@ function makeProgressBar(value, maximum, opts={}) {
var options = opts || {};
value = parseFloat(value);
value = formatDecimal(parseFloat(value));
var percent = 100;
// Prevent div-by-zero or null value
if (maximum && maximum > 0) {
maximum = parseFloat(maximum);
percent = parseInt(value / maximum * 100);
maximum = formatDecimal(parseFloat(maximum));
percent = formatDecimal(parseInt(value / maximum * 100));
}
if (percent > 100) {