1 pièce(s) jointe(s)
Afficher seulement 2 décimales
Bonjour,
jai réalisé ce tableau et dans mon calcul automatique du pourcentage de ma remise je souhaiterais ne faire apparaitre que les 2 premiers chiffres après la virgule, quelqu'un peut-il m'aider ?
voici l'image de mon tableau :
Pièce jointe 182697
voici mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| for($i=0;$i<$nbreArticles;$i++){
$remise = $_SESSION['panier']['reduction'][$i];
$montantTotal = montantTotal() - $remise;
$affichage_panier .= '<tr><td>' . $_SESSION['panier']['titre'][$i] . '</td>
<td><img src="' . $_SESSION['panier']['photo'][$i] . '" id="miniature_article" alt=""></td>
<td>' . $_SESSION['panier']['ville'][$i] . '</td>
<td>' . $_SESSION['panier']['capacite'][$i] . '</td>
<td>' . $_SESSION['panier']['date_arrivee'][$i] . '</td>
<td>' . $_SESSION['panier']['date_depart'][$i] . '</td>
<td>' . $_SESSION['panier']['prix'][$i] . ' </td>
<td>' . $_SESSION['panier']['reduction'][$i] . ' </td>
<td>' . $_SESSION['panier']['reduction'][$i] *100 / $_SESSION['panier']['prix'][$i]. ' </td>
<td>' . $montantTotal * 20 / 100 . ' </td>
<td><a href="panier.php?action=supprimer_article&id_articleASupprimer=' . $i . '"><img src="styles/icones/supp.png" alt="supprimer un article"></a></td>
</tr>';
}
$affichage_panier .= '<tr>
<th colspan="6">TOTAL DE VOTRE COMMANDE </th>
<th colspan="2"> HT : ' . $montantTotal . ' </th>
<th colspan="2"> TTC : ' . $montantTotal * 1.2 . ' </th>
</tr>
</table> |