我有一个类似于 4.0157725356416E+24 的浮点数组,它们没有被四舍五入round()
。(看门狗是一个drupal日志工具)
$score = ($results['results'][0]['score']);
watchdog( 'multi', "float: $score");
$score = ($score * 100);
watchdog( 'multi', "percent (". gettype($score) . "): $score");
$score = round( $score );
watchdog( 'multi', "round: $score");
这个的输出是:
> float: 1.9532660466727E+25
> percent (double): 1.9532660466727E+27
> round: 1.9532660466727E+27
我在这里遗漏了一些东西......