From 193a878112c50955e986ce3b86d5cfbed6587377 Mon Sep 17 00:00:00 2001 From: Kseninia Mikhaylova Date: Fri, 26 Jul 2024 09:31:48 +0300 Subject: [PATCH] round --- components/calcValues.vue | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/calcValues.vue b/components/calcValues.vue index aaa41c1..a350701 100644 --- a/components/calcValues.vue +++ b/components/calcValues.vue @@ -101,13 +101,12 @@ const changeParametres = () => { if (full_sections == 0) { length = total_length_mm - fence_length - fence_length } - let total_length_calc = (full_sections * length) + (full_sections * fence_length) + fence_length - if ((total_length_mm - total_length_calc) > 0 && (total_length_mm - total_length_calc) < fence_length) { - full_sections -= 1 - } } let total_length_calc = (full_sections * length) + (full_sections * fence_length) + fence_length - if (total_length_calc < total_length_mm) { + if (Math.round(total_length_mm - total_length_calc) > 0 && Math.round(total_length_mm - total_length_calc) <= fence_length) { + full_sections -= 1 + } + if (Math.round(total_length_mm - total_length_calc) > 0) { form_state.extra_section = total_length_mm - total_length_calc - fence_length } else { form_state.extra_section = 0 -- 2.40.1