Merge pull request 'more calc' (#54) from bx-1146-more_calc into dev
Deploy / build_and_push_images (push) Successful in 1m23s Details
Deploy / deploy_to_server_dev (push) Successful in 39s Details

Reviewed-on: #54
This commit is contained in:
ksenia_mikhailova 2024-07-26 09:20:51 +03:00
commit d18f08d095
1 changed files with 5 additions and 4 deletions

View File

@ -101,13 +101,14 @@ const changeParametres = () => {
if (full_sections == 0) { if (full_sections == 0) {
length = total_length_mm - fence_length - fence_length length = total_length_mm - fence_length - fence_length
} }
if ((total_length_mm - ((full_sections * length) + (full_sections * fence_length) + 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 full_sections -= 1
} }
} }
let total_length_calc = (full_sections * length) + (full_sections * fence_length) + fence_length
if (((full_sections * length) + (full_sections * fence_length) + fence_length) < total_length_mm) { if (total_length_calc < total_length_mm) {
form_state.extra_section = total_length_mm - ((full_sections * length) + (full_sections * fence_length) + fence_length) - fence_length form_state.extra_section = total_length_mm - total_length_calc - fence_length
} else { } else {
form_state.extra_section = 0 form_state.extra_section = 0
} }