• Resolved twizz

    (@twizz)


    Hello SportsPress Team,

    I’m creating a site for a single team that only competes in tournaments and having quite a bit of difficulty getting everything to function correctly. At the moment, I can’t seem to figure out how to get the batting averages to automatically calculate. I’m using the Rookie theme. I’ve created a League, a Competition, an Event, a Team, a Player List, a single Player, and Venues. Batting Average is calculated as Hits (H) divided by At Bats (AB). However, no matter where I enter information for H and AB, AVG is never automatically calculated. What am I doing wrong?

    -Twizz

    ps. I don’t have any other plugins activated.

    https://www.ads-software.com/plugins/sportspress/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi!

    Would you mind sending us an example so we can see what is being shown there?

    Kind Regards,
    -Roch

    Thread Starter twizz

    (@twizz)

    Hey Roch,

    Please take a look at this link.

    Thanks,
    Twizz

    Thanks, twizz

    If the math in your hits average is being calculated make sure you have the *100 multiplier. I believe the issue there is that all averages are being rounded to zero (for example 0.5 = 0)

    Kind Regards,
    -Roch

    Thread Starter twizz

    (@twizz)

    The batting average is built into the theme and the average should include 3 decimal places. If I multiply by 100, that will change a .300 average to 30. I’ve been trying to search through the code to find the equation, but have come up empty handed. Do you know what file it’s in?

    -Twizz

    Thread Starter twizz

    (@twizz)

    Hey Roch,

    I found the problem.

    The variable ‘avg’ was configured in both the Player Performance AND Player Statistic sections. Since the actual equation used to compute ‘avg’ is in the Statistic section, I removed the variable from the Performance section. I immediately checked the player’s page and everything appears to be functioning as expected, now.

    I realized where the conflict was after looking at /wp-content/plugins/sportspress/presets/team-sports/softball.json and noticing AVG didn’t exist in the “performance” array. Although I can’t remember doing so, I must have created the Player Performance ‘avg’ variable at some point.

    Thanks for trying to help me solve this!
    -Twizz

    Hi Twizz!

    Thanks a lot for sharing how you’ve solved this! We’ll look into this to avoid future issues.

    Kind Regards,
    -Roch

    Hi! I have the same problem, the field AVG (preset in the plugin) doesn’t fill automaticly with the value (which should be something like .nnn e.g. .350).

    How can I fix the problem? Thanks,
    Toti.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Softball Batting Average Not Computing’ is closed to new replies.