ref(js): utilise parseInt plutôt que Number

pull/54/head
François Poulain 2022-02-18 14:34:04 +01:00
parent 6ab3879522
commit 5f644cd30d
1 changed files with 2 additions and 2 deletions

View File

@ -16,10 +16,10 @@ $(() => {
const error = wrapper.parent().find('.invalid-feedback:contains(mandats disponibles)');
const inputs = wrapper.find('input');
$(inputs).on('change', () => {
const availableInt = Number(available[0].textContent);
const availableInt = parseInt(available[0].textContent, 10);
const affected = inputs.map((idx, elem) => elem.value).get()
.reduce((pv, cv) => {
return pv + (Number(cv) || 0);
return pv + (parseInt(cv, 10) || 0);
}, 0);
if (availableInt - affected >= 0) {
remaining[0].textContent = availableInt - affected;