You can call number_format() on the lone returned value from your query if you want a formatted string with thousands placeholders otherwise use round() to return a float value.
public function getAveRating(int $restoid): float { return round( $this->db ->select_avg('rate') ->get_where('ratings', ['restoid' => $restoid]) ->row('rate'), 2 ); } Or you could round in the query itself.
public function getAveRating(int $restoid): float { return (float)$this->db ->select('ROUND(AVG(rate), 2) rate') ->get_where('ratings', ['restoid' => $restoid]) ->row('rate'); }