PHP code example of wisonlau / report-calculate
1. Go to this page and download the library: Download wisonlau/report-calculate library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wisonlau / report-calculate example snippets
echo (19.99 * 100) . "\n"; // 1999
echo (int)(19.99 * 100) . "\n"; // 1998
echo $this->getInt(19.99 * 100) . "\n"; // 1999
echo (0.1 + 0.7) . "\n";
if ( (0.1 + 0.7) == 0.8 )
{
echo '相等' . "\n";
}
else
{
echo '不相等' . "\n"; // this
}
$a = 0.1 + 0.7; // 0.8
if ( $a == 0.8 )
{
echo '一天一小步' . "\n";
}
else
{
echo '一年一大步' . "\n"; // this
}
$a = $this->getFloat(0.1 + 0.7);
if ( $a == 0.8 )
{
echo '一天一小步1' . "\n"; // this
}
else
{
echo '一年一大步1' . "\n";
}
echo intval((0.1 + 0.7) * 10) . "\n";
echo $this->getInt((0.1 + 0.7) * 10) . "\n"; // 8
echo $this->getFloat((0.11 + 0.7) * 10) . "\n"; // 8.1