2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 03:25:42 +00:00

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

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) {