• We run a snooker competition where players are allocated a frame starting handicap for the season, which goes up by two points for each frame lost and down by two points for each win. The formula I’ve defined in SportsPress is:

    starthcp – (2 * (frameswon – frameslost))

    This works fine for all players except those whose starting handicap for the season is zero, where the formula doesn’t correctly calculate what their present handicap should be based on their wins and losses (it always outputs zero). I have found that if I enter their starting handicap as “0” rather than 0, then the formula calculates the current handicap correctly. For all players with a non-zero starting handicap, I can just enter the numeric value without quotes and the calculation works correctly, but the zero requires quotes around it. Why does this happen?

    Running SportsPress 2.7.24 on WordPress 6.7.2.

    • This topic was modified 1 week, 1 day ago by NickJP.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Savvas

    (@savvasha)

    Hi @nickjp ,

    Can you share some screenshots that will help me recreate your issue?

    Thanks,
    Savvas

    Thread Starter NickJP

    (@nickjp)

    Here’s screenshot of the formula for calculating a players handicap depending on the number of frames they have won and lost:

    In the player metrics, a non-zero starting handicap for a player can be entered just as the digit and the formula works fine for calculating their handicap:

    For a player with a starting handicap of zero, if the value is entered just as 0, the handicap formula just outputs zero regardless of the values for Frames W and Frames L. If I surround the 0 with quotes then the formula works correctly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.