Format number with explicit decimal places

This commit is contained in:
Brian Miyaji
2014-05-31 00:00:02 +10:00
parent 363c3b1532
commit a1cb218da0
2 changed files with 7 additions and 2 deletions

View File

@@ -264,6 +264,11 @@ class SP_League_Table extends SP_Custom_Post{
// Adjustments
$placeholder += sp_array_value( sp_array_value( $adjustments, $team_id, array() ), $stat->post_name, 0 );
// Format number
if ( $placeholder != '-' ):
$placeholder = number_format( $placeholder, $stat->precision );
endif;
endif;
$placeholders[ $team_id ][ $stat->post_name ] = $placeholder;

View File

@@ -870,8 +870,8 @@ if ( !function_exists( 'sp_solve' ) ) {
$eos = new eqEOS();
// Solve using EOS
return round( $eos->solveIF( str_replace( ' ', '', $equation ), $vars ), $precision );
// Solve using EOS;
return number_format( $eos->solveIF( str_replace( ' ', '', $equation ), $vars ), $precision );
else:
return 0;
endif;