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:
parent
dc8b986fc6
commit
ce323d80ea
@ -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() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user