Fix decimal places dropped from player list statistics

This commit is contained in:
Brian Miyaji
2017-01-31 19:25:33 +11:00
parent 3132d8832f
commit 21fb7d57f7

View File

@@ -555,10 +555,12 @@ class SP_Player_List extends SP_Custom_Post {
endif;
if ( $placeholder !== '' && is_numeric( $placeholder ) ):
$placeholders[ $player_id ][ $stat->post_name ] = sp_array_value( $placeholders[ $player_id ], $stat->post_name, 0 ) + $placeholder;
$placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, 0 ) + $placeholder;
else:
$placeholders[ $player_id ][ $stat->post_name ] = sp_array_value( $placeholders[ $player_id ], $stat->post_name, '-' );
$placeholder = sp_array_value( $placeholders[ $player_id ], $stat->post_name, '-' );
endif;
$placeholders[ $player_id ][ $stat->post_name ] = number_format( $placeholder, $stat->precision, '.', '' );
endforeach;
endforeach;