refactor: update default material usage value and ensure consistent formatting to two decimal places across Cutting components for improved clarity
This commit is contained in:
parent
fc234a6afd
commit
22dce97e49
@ -329,7 +329,7 @@ async function addMaterial(
|
||||
(item) => item.raw_material_price_id === price.id,
|
||||
);
|
||||
|
||||
const defaultUsage = '100';
|
||||
const defaultUsage = '1';
|
||||
const increment = 1;
|
||||
const nextUsage = existing
|
||||
? String((Number(existing.material_usage) || 0) + increment)
|
||||
|
||||
@ -25,7 +25,7 @@ function getTotalMaterialUsageUnit(materials: any[]): string {
|
||||
}
|
||||
|
||||
function formatMaterialUsage(mat: any): string {
|
||||
return (mat.material_usage ?? 0).toFixed(2);
|
||||
return Number(mat.material_usage ?? 0).toFixed(2);
|
||||
}
|
||||
|
||||
function getMaterialUnit(mat: any): string {
|
||||
|
||||
@ -16,7 +16,7 @@ function getTotalMaterialUsageUnit(materials: any[]): string {
|
||||
}
|
||||
|
||||
function formatMaterialUsage(mat: any): string {
|
||||
return (mat.material_usage ?? 0).toFixed(2);
|
||||
return Number(mat.material_usage ?? 0).toFixed(2);
|
||||
}
|
||||
|
||||
function getMaterialUnit(mat: any): string {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user