From 58b26e4030b9bcc43cea11d1e7faa117b7a8c5c1 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Wed, 3 Jul 2024 13:55:06 +0300 Subject: [PATCH] calc sections on smaller --- components/calcValues.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/calcValues.vue b/components/calcValues.vue index f8fd931..1957faf 100644 --- a/components/calcValues.vue +++ b/components/calcValues.vue @@ -77,7 +77,7 @@ const changeParametres = () => { if (auto_length) { let w = parametric.length.min - const max_sections = Math.ceil((total_length_mm - fence_length) / (parametric.length.min + fence_length)) + const max_sections = Math.floor((total_length_mm - fence_length) / (parametric.length.min + fence_length)) const min_sections = Math.ceil((total_length_mm - fence_length) / (parametric.length.max + fence_length)) for (let index = min_sections; index <= max_sections; index++) { @@ -92,6 +92,8 @@ const changeParametres = () => { } } length = w + } else { + full_sections = Math.floor((total_length_mm - fence_length) / (length + fence_length)) } if (((full_sections * length) + (full_sections * fence_length) + fence_length) <= total_length_mm) {