- round: documentation ( source)
- var_export: documentation ( source)
- ini_get: documentation ( source)
<?php
echo var_export(20 / 3, true) . "\n";
echo var_export(6.66, true) . "\n";
echo var_export(6.0, true) . "\n";
echo "\n";
function format($f) {
$p = (int) ini_get('precision');
$out = var_export(round($f, $p));
if (($pos = str_pos('.', $out)) !== FALSE && strlen($out) - $pos > $p) {
}
}
$p = (int) ini_get('precision');
echo var_export(round(20 / 3, $p)) . "\n";
echo var_export(round(6.66, $p)) . "\n";
echo var_export(round(6.0, $p)) . "\n";