What are common methods in PHP for rounding numbers and what are the potential pitfalls when dealing with large numbers?

When rounding numbers in PHP, common methods include using the round() function, number_format() function, or manual rounding with mathematical operations. When dealing with large numbers, potential pitfalls include loss of precision due to floating-point arithmetic and unexpected results when using certain rounding methods.

// Using round() function to round a number to a specified number of decimal places
$number = 1234.56789;
$rounded_number = round($number, 2);
echo $rounded_number; // Output: 1234.57