How can the ceil function affect the formatting of numbers in PHP?

The ceil function in PHP rounds a number up to the nearest integer, which can affect the formatting of numbers by removing decimal points or digits after the decimal point. To maintain the original formatting of numbers while using the ceil function, you can first store the number in a variable, apply the ceil function to it, and then format it as needed using number_format or sprintf.

$number = 10.75;
$rounded_number = ceil($number);
$formatted_number = number_format($rounded_number, 2); // Format to 2 decimal places
echo $formatted_number; // Output: 11.00