PageRenderTime 43ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/website/source/php/math/ceil.html

https://github.com/andriuspetrauskis/phpjs
HTML | 37 lines | 36 code | 1 blank | 0 comment | 0 complexity | 89bfb2750a4977a8b470167eb63e4f72 MD5 | raw file
  1. ---
  2. warning: 'This file is auto generated by `npm run web:inject`, do not edit by hand'
  3. examples:
  4. - ceil(8723321.4)
  5. estarget: es5
  6. returns:
  7. - '8723322'
  8. dependencies: []
  9. authors:
  10. original by:
  11. - 'Onno Marsman (https://twitter.com/onnomarsman)'
  12. notes: []
  13. type: function
  14. layout: function
  15. title: PHP's ceil in JavaScript
  16. description: >-
  17. Heres what our current JavaScript equivalent to <a
  18. href="http://php.net/manual/en/function.ceil.php">PHP's ceil</a> looks like.
  19. function: ceil
  20. category: math
  21. language: php
  22. permalink: php/math/ceil/
  23. alias:
  24. - /functions/php/ceil/
  25. - /functions/math/ceil/
  26. - /php/ceil/
  27. - /functions/ceil/
  28. ---
  29. {% codeblock lang:javascript %}module.exports = function ceil (value) {
  30. // discuss at: http://locutus.io/php/ceil/
  31. // original by: Onno Marsman (https://twitter.com/onnomarsman)
  32. // example 1: ceil(8723321.4)
  33. // returns 1: 8723322
  34. return Math.ceil(value)
  35. }
  36. {% endcodeblock %}