Horje Website
PHP Get Ceil and Floor Value of a Number – Learn Get ceil and floor value of a number – PHP Code

PHP Get Ceil and Floor Value of a Number – Learn Get ceil and floor value of a number

PHP Get Ceil and Floor Value of a Number - Learn Get ceil and floor value of a number - PHP Code


 
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>PHP Get Ceil and Floor Value of a Number</title>
  5. </head>
  6. <body>
  7. <?php
  8. // Round fractions up
  9. echo ceil(4.2) . "<br>"; // 0utputs: 5
  10. echo ceil(9.99) . "<br>"; // 0utputs: 10
  11. echo ceil(-5.18) . "<br>"; // 0utputs: -5
  12. // Round fractions down
  13. echo floor(4.2) . "<br>"; // 0utputs: 4
  14. echo floor(9.99) . "<br>"; // 0utputs: 9
  15. echo floor(-5.18) . "<br>"; // 0utputs: -6
  16. ?>
  17. </body>
  18. </html>



Try Your Self ->



Published:
September 25, 2020
Author:
admin
Category:
PHP Basic, PHP Source Code
Views:
16

This article was posted in PHP Basic, PHP Source Code and tagged , , . Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Horje © 2011 - 2022