2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-30 12:36:45 +00:00

Fix floating point issues

This commit is contained in:
Oliver Walters 2022-03-27 20:29:59 +11:00
parent dc8b986fc6
commit ce323d80ea

View File

@ -1025,9 +1025,10 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
} }
// Store the required quantity in the row data // Store the required quantity in the row data
row.required = quantity; // Prevent weird rounding issues
row.required = parseFloat(quantity.toFixed(15));
return quantity; return row.required;
} }
function sumAllocations(row) { function sumAllocations(row) {
@ -1043,9 +1044,9 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
quantity += item.quantity; quantity += item.quantity;
}); });
row.allocated = quantity; row.allocated = parseFloat(quantity.toFixed(15));
return quantity; return row.allocated;
} }
function setupCallbacks() { function setupCallbacks() {