What are the potential pitfalls when formatting numbers with decimal separators in PHP?

When formatting numbers with decimal separators in PHP, a potential pitfall is that different locales may use different decimal separators (e.g., a comma in some countries and a period in others). To ensure consistent formatting, you can use the `number_format` function with the `locale` parameter set to `LC_NUMERIC` to force the use of a period as the decimal separator.

$number = 1234.56;
setlocale(LC_NUMERIC, 'en_US.UTF-8');
$formatted_number = number_format($number, 2, '.', ',');
echo $formatted_number;