BaseballPlayer::get_batting_average

Returns the batting average for a player.

Parameters

  • int $at_bats — The number of at bats.
  • int $hits — The number of hits.

Returns

  • float|string — The batting average for the player.

Since: 2.0

Source

  • /includes/classes/sports/baseball/baseball-player.php — 75