PageRenderTime 53ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/2.0/Tests/Math/round.php

#
PHP | 23 lines | 20 code | 3 blank | 0 comment | 0 complexity | 37df24c160c3ffac99207ab43ed86eb0 MD5 | raw file
Possible License(s): CPL-1.0, GPL-2.0, CC-BY-SA-3.0, MPL-2.0-no-copyleft-exception, Apache-2.0
  1. [expect php]
  2. [file]
  3. <?php
  4. echo round(3.4); // 3
  5. echo "\n";
  6. echo round(3.5); // 4
  7. echo "\n";
  8. echo round(3.6); // 4
  9. echo "\n";
  10. echo round(3.6, 0); // 4
  11. echo "\n";
  12. echo round(1.95583, 2); // 1.96
  13. echo "\n";
  14. echo round(1241757, -3); // 1242000
  15. echo "\n";
  16. echo round(5.045, 2); // 5.05
  17. echo "\n";
  18. echo round(5.055, 2); // 5.06
  19. echo "\n";
  20. ?>