What are the potential pitfalls when adding Euro amounts in PHP and displaying them with decimal places?
When adding Euro amounts in PHP and displaying them with decimal places, a potential pitfall is losing precision due to floating-point arithmetic. To avoid this issue, it's recommended to use the `number_format` function to format the output with the desired number of decimal places.
$amount1 = 10.55;
$amount2 = 20.75;
$total = $amount1 + $amount2;
echo number_format($total, 2, ',', '.') . ' €'; // Output: 31,30 €