that is my code
<?php
$sql = $wpdb->put together( " SELECT meta_value FROM {$wpdb->prefix}commentmeta INNER JOIN {$wpdb->prefix}feedback ON {$wpdb->prefix}commentmeta.comment_id = {$wpdb->prefix}feedback.comment_ID WHERE comment_post_ID = %d AND meta_key = 'score' ", get_the_ID() ); $outcomes = $wpdb->get_results( $sql );
foreach($outcomes as $outcome){
$price = $result->meta_value;
$sum +=$price;
}
$res = $sum/rely ($outcomes);
$res = number_format((float)$res,1,'.','');
?>
That is the output
<?php echo $res ?>