diff --git a/components/calcValues.vue b/components/calcValues.vue index dca5085..40a4483 100644 --- a/components/calcValues.vue +++ b/components/calcValues.vue @@ -87,10 +87,10 @@ const changeParametres = () => { const section_without_pillar = form_state.length - form_state.fence_length - form_state.full_sections = Math.ceil(total_without_pillar / section_without_pillar) + form_state.full_sections = Math.floor(total_without_pillar / section_without_pillar) - if (section_without_pillar * form_state.full_sections == form_state.full_sections) { - form_state.extra_section = Math.ceil(total_without_pillar % section_without_pillar) + if (section_without_pillar * form_state.full_sections !== form_state.full_sections) { + form_state.extra_section = Math.floor(total_without_pillar % section_without_pillar) } else { form_state.extra_section = 0 }