Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2013

    Unanswered: Help calculating bowling average for cricket

    Hi all

    Ive all but finished my cricket stats database but am stuck with the bowling part, when a bowler fails to complete an over it would look something like:

    Overs bowled 12.3

    This means they bowled 12 overs and 3 balls, when 6 balls have been bowled the over is completed but to calculate total overs bowled in a season i need to add all the overs and balls bowled together. The problem is scenario below

    Match 1 - 12.4 overs
    Match 2 - 9.5 overs

    Total overs 21.9 overs ??????

    Should be 22.3

    This is not correct as there arent 9 balls in an over only 6, so when the balls equals 6 it adds another over on the over count and starts again at 0?

    Can someone help? to those who have a knowledge of cricket this will make alot more sense.

  2. #2
    Join Date
    Jan 2007
    Provided Answers: 12
    Fundamentally I think you have a problem with your database design: you should not be storing the number of bowls in that format.

    Store it as a total number of bowls if you have to and then calculate the overs from this.

    That calculation is pretty simple... pseudo-code:
    overs = number of bowls MOD 6
    remaining bowls = FLOOR ( number of bowls / 6)
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts