diff --git a/Vue/Ficheadherent/index.php b/Vue/Ficheadherent/index.php index 2619b48..9df6461 100644 --- a/Vue/Ficheadherent/index.php +++ b/Vue/Ficheadherent/index.php @@ -370,11 +370,14 @@ return currencyConfig.format(value); }; - // Format pourcentage - const formatPercentage = (value, total) => { - const percentage = (value * 100 / total).toFixed(1); - return percentage + '%'; - }; + // Format pourcentage sécurisé + const formatPercentage = (value, total) => { + if (total === 0) { + return '0%'; // ou éventuellement 'N/A' selon ton besoin + } + const percentage = (value * 100 / total).toFixed(1); + return percentage + '%'; + }; // Détection mobile const isMobile = window.matchMedia("(max-width: 768px)").matches;