• Resolved ivomcneves

    (@ivomcneves)


    Hi,

    The League Table widget presents a list with erros (Warning: number_format() expects parameter 2 to be long, string given in /home/x22bkf1m/public_html/wp-content/plugins/sportspress/includes/sp-core-functions.php on line 1344

    Warning: number_format() expects parameter 2 to be long, string given in /home/x22bkf1m/public_html/wp-content/plugins/sportspress/includes/class-sp-league-table.php on line 591) in my website after I had changed the host and without touching anything in this plugin files.

    I have already unninstall and install the plugin but doesn’t work.

    Can you help me please?

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Roch

    (@rochesterj)

    Hi!

    Thanks for reaching out!

    This looks like an issue with the decimal places for your metrics. Please kindly check them all and make sure they have a number (either zero or a different one).

    To make sure there’s no corrupt data, even if you see a number hit update to make sure that is sent to your database again.

    Thanks!

    Kind Regards,
    -Roch

    Thread Starter ivomcneves

    (@ivomcneves)

    Hi,

    Thank you for your feedback.

    Here are the lines that are causing the errors:

    provo$placeholder = number_format( $placeholder, $stat->precision, ‘.’, ” );

    return number_format( $eos->solveIF( str_replace( ‘ ‘, ”, $equation ), $vars ), $precision, ‘.’, ” );

    Since I tried many options and didn’t work, can you tell me what I exactly should modify please?

    Thank you!

    Roch

    (@rochesterj)

    Hi!

    Thanks for your reply.

    We don’t recommend editing any plugin files, specially since it was working before (and works fine for other users). It’s certainly an issue in your data so fixing it is the best way to go.

    Please send us a screenshot of your SportsPress > Configure screen so we can see your stats.

    Thanks!

    Kind Regards,
    -Roch

    Thread Starter ivomcneves

    (@ivomcneves)

    Hi!

    Thank you for your help.

    Here’s the screenshots:
    https://prntscr.com/ftsope
    https://prntscr.com/ftsoz5

    Thank you again,

    Roch

    (@rochesterj)

    Hi!

    Thanks for that!

    I can see here that all of them have zero as the precision, except for the last 3 stats (with 2 decimal places).

    Just to make sure none of them is wrong, please try setting them all as 1 decimal place and the last 3 as 3 decimal places.

    THanks!

    Kind Regards,
    -Roch

    Thread Starter ivomcneves

    (@ivomcneves)

    Hi!

    I set them all as 1 decimal place and the last 3 as 3 decimal places and then I set them all with zero as the precision, except for the last 3 stats (with 2 decimal places) again and it worked. The errors are gone. It must have been for changing the host, not knowing exactly why.

    Thank you again for all the support!

    Roch

    (@rochesterj)

    Hi!

    That’s awesome!

    Indeed, sometimes data may be lost in between for some weird reason.

    I’m glad it’s all fixed for you.

    Thanks!

    Kind Regards,
    -Roch

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘The League Table widget number_format error’ is closed to new replies.