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

pull/54/head
François Poulain 2022-02-18 14:34:04 +01:00
Parent 6ab3879522
révision 5f644cd30d
1 fichiers modifiés avec 2 ajouts et 2 suppressions

Voir le fichier

@ -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;