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:
Yoga Pangestu 2026-06-21 13:02:31 +07:00
parent fc234a6afd
commit 22dce97e49
3 changed files with 3 additions and 3 deletions

View File

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

View File

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

View File

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