What are some best practices for maintaining code readability and efficiency when formatting numbers in PHP?

When formatting numbers in PHP, it is important to maintain code readability and efficiency by using built-in functions such as number_format() to properly format numbers with thousands separators and decimal points. Additionally, using comments to explain the formatting logic can improve code readability for other developers.

// Format a number with thousands separators and two decimal places
$number = 1234567.89;
$formatted_number = number_format($number, 2);
echo $formatted_number;