Format number with explicit decimal places
This commit is contained in:
@@ -264,6 +264,11 @@ class SP_League_Table extends SP_Custom_Post{
|
|||||||
|
|
||||||
// Adjustments
|
// Adjustments
|
||||||
$placeholder += sp_array_value( sp_array_value( $adjustments, $team_id, array() ), $stat->post_name, 0 );
|
$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;
|
endif;
|
||||||
|
|
||||||
$placeholders[ $team_id ][ $stat->post_name ] = $placeholder;
|
$placeholders[ $team_id ][ $stat->post_name ] = $placeholder;
|
||||||
|
|||||||
@@ -870,8 +870,8 @@ if ( !function_exists( 'sp_solve' ) ) {
|
|||||||
|
|
||||||
$eos = new eqEOS();
|
$eos = new eqEOS();
|
||||||
|
|
||||||
// Solve using EOS
|
// Solve using EOS;
|
||||||
return round( $eos->solveIF( str_replace( ' ', '', $equation ), $vars ), $precision );
|
return number_format( $eos->solveIF( str_replace( ' ', '', $equation ), $vars ), $precision );
|
||||||
else:
|
else:
|
||||||
return 0;
|
return 0;
|
||||||
endif;
|
endif;
|
||||||
|
|||||||
Reference in New Issue
Block a user