Are there any specific PHP best practices to follow when converting numerical values for display?

When converting numerical values for display in PHP, it is best practice to format the numbers appropriately to improve readability and user experience. This can include adding thousands separators, specifying decimal precision, and choosing the appropriate number format based on the context.

// Example of converting a numerical value for display with thousands separator and decimal precision
$number = 1234567.89;
$formatted_number = number_format($number, 2, '.', ',');
echo $formatted_number; // Output: 1,234,567.89