Skip to content

Instantly share code, notes, and snippets.

@iamsujun
Last active August 29, 2015 14:16
Show Gist options
  • Save iamsujun/81228b9bc6707cd98620 to your computer and use it in GitHub Desktop.
Save iamsujun/81228b9bc6707cd98620 to your computer and use it in GitHub Desktop.
PHP浮点型乘积取整
<?php
echo (0.58*100) . "<br>";
echo (int)(0.58*100) . "<br>";
echo (1234.11 * 100) . "<br>";
echo (int)(1234.11 * 100) . "<br>";
echo intval(1234.12 * 100) . "<br>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment