From: Ævar Arnfjörð Bjarmason Date: Thu, 21 Apr 2005 03:59:26 +0000 (+0000) Subject: Using sprintf "%.2f" to output the final percentage X-Git-Tag: 1.5.0alpha1~213 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=17783cd09831029fabd9372bbc246a44d62c14ae;p=lhc%2Fweb%2Fwiklou.git Using sprintf "%.2f" to output the final percentage --- diff --git a/maintenance/parserTests.php b/maintenance/parserTests.php index b574bda86c..4443334d88 100644 --- a/maintenance/parserTests.php +++ b/maintenance/parserTests.php @@ -187,7 +187,7 @@ class ParserTest { } } if( $total > 0 ) { - $ratio = IntVal( 100.0 * $success / $total ); + $ratio = sprintf( "%.2f", 100 * $success / $total ); print $this->termColor( 1 ) . "\nPassed $success of $total tests ($ratio%) "; if( $success == $total ) { print $this->termColor( 32 ) . "PASSED!";