This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Active challenges current values do not appear anywhere

Former Member
Former Member

I go to Challengs and enter in any challenge (ex: October Ride to 400) and no value are show:

this is happening in Safari and Chrome, and in challenges like October rundown, 

  • Looks all right in my account. Try signing out, clearing browser's cache (temporary files), and signing back in.

  • Former Member
    0 Former Member over 4 years ago in reply to trux

    Did that, and the error persists. I looked at the Inspect/Console and it gives me a bunch of errors

  • What version does it report in the footer of the page? mine reports 4.36.0.17, 20.21.2.

    Did yout try turning off plugins such as adblockers, that could attempt modifying the content of the page? Did you try it from another computer or a phone?

  • I got the exact same issue in all browsers I've tested. Tested with two computers and one phone. Turned off all plugins. Still the same error.

    It is just visual. The progress bar is correct. It is only the progress value that shows 0.0.

    It works in the app so I check the exact value there. You could also inspect the progress bar and get the percentage for the width of the blue part of the bar and calculate the value yourself Slight smile

  • Yes, challenges with distance units, like KM, show 0.

    Only steps challenges show correct number.

     

    Values can be read from JSON:
    October Ride to 400:
    https://connect.garmin.com/modern/proxy/badgechallenge-service/badgeChallenge/7E5F70DAFCFB4040BBEA672DCA20DA9E

  • Yes, challenges with distance units, like KM, show 0.

    My challenges still work fine. What version does your GC Web show?

  • Your challenges display correct number, because you are using decimal point separator.

    Yes, that's a workaround. Change Number Format in Settings.

     

    But rounding function on Connect website is just wrong,
    it produces NaN values if a user use decimal comma separator.

    Example: 80.4672 - "0,47" = NaN

    (n, 'roundDecimal', function (e, t)   //e:80.4672  t:true
    {
        var i = this.formatDecimalNumber(e % 1, 2),
        n = e - i,       //n:NaN  e:80.4672
        r = i;           //r:"0,47"  i:"0,47"
        return r = t ? Math.ceil(10 * i) / 10 : Math.floor(10 * i) / 10,
        this.formatDecimalNumber(n + r, 1)

  • Former Member
    0 Former Member over 4 years ago in reply to BunBun!

    It worked, however it's strange to me to see the decimal separator with a dot

  • True, that's why normally numbers are localized, so everybody can see a format they used to.

     

    But I'm more confused about this rounding function.

    It works with point separator only because Javascript allows combining numbers with strings. There is clearly wrongly used format string function before calculations.

    But even if there was a numeric rounding for i variable, I still don't understand why this function is so complicated.

    This is how it rounds 80.4672 to "80.5":

    function(e=80.4672, t=true)
    {
        i = formatDecimalNumber(80.4672 % 1, 2) = "0.47"
        n = 80.4672 - "0.47" = 79.9972
        r = "0.47"
        return r = true ? 0.5 : 0.4, formatDecimalNumber(79.9972 + 0.5, 1) = "80.5"
    }

  • They removed that wrongly used localized formatting function on i variable:

    i = this.formatDecimalNumber(e % 1, 2)

    so challenges again show progress values also with decimal comma separator.

    i = (e % 1).toFixed(2)

    But from code side, toFixed() also returns a formatted string, with dot, so it works, but it's double converted (numeric -> string -> numeric), maybe better would be Math.round() which would keep value numeric.