What is the common issue with displaying numbers with 2 decimal places in PHP?

When displaying numbers with 2 decimal places in PHP, a common issue is that the numbers may not always be rounded as expected due to floating-point precision errors. To solve this issue, you can use the number_format() function in PHP, which allows you to format a number with a specific number of decimal places.

$number = 10.555;
$formatted_number = number_format($number, 2);
echo $formatted_number; // Output: 10.56