ccomeaux / boardgamegeek4android

BoardGameGeek application for Android (unofficial)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with decimals scores

zoki666 opened this issue · comments

If a match is scored with decimals, the statistics are shown incorrect.

It may have something to do with the decimal symbol depending on the language (in some places comma, in other places), I don't know ...

I see same bug here. In Poland we use comma as a decimal separator, I think that generates bugs here.

When I input a fractional score e.g. 64.5 it saves and shows up as 64,5 (comma instead of period) → AND I suppose then app doesn't count it as a number. This causes three bugs:

  1. An opponent with lower integer score (e.g. 62) is automatically selected as winner.
  2. If I want to change the score again, it disappears in numpad view.
  3. The score doesn't count for player's stats (because it's NaN).

O.K., I checked that. This changes with system settings. When I set my phone default language to English the score is saved 64.5 and:

  1. it wins with 62,
  2. is editable,
  3. is included in stats.
    When I change back to Polish everything works fine (like in English) until restart of the app… (I suppose then it reads the default language setting).

This will require a little research. I glanced at the code, and what I looked at I thought would handle localization. Since BGG stores the score as a string instead of a number, I have to do some parsing in the app to determine it's a number. I think I can fix this in the next minor release.

(I don't know if you saw my second comment as I wrote it in the same moment you wrote yours).

I am not sure how it is in Java/Kotlin but I've been using JavaScript for years and one can use +d to parse variable d into a number (and any string that is not a number parses to 0).

E.g. if d="1" then d + 2 => "12" and +d + 2 => 3.

Maybe just enforce using AND showing with period? Like in English notation. Just for now, as a workaround. Then we'll think of prettyfying it.

OK, I've figured out how to enter a "," as a decimal separator, or whatever your phone's locale is set to. I switched my phone to Polish, I was able to enter "62,5" and it treated it like 62 and a half. So that fixes your fix 2 bugs.

To be clear, the player's stats it doesn't count for is on the game's play stats page where is shows min/max/average scores?

Yes, game's Play stats. Example below.
Screenshot_20200924-223057
Screenshot_20200924-223121

I believe this eeb2278 is the solution you are talking about? 😀

Has anybody found the no-fractions in stats issue?

Is this supposed to be fixed? Because I think I still have the issue 🤔

Is this supposed to be fixed? Because I think I still have the issue 🤔

I dunno about the statistics, but what I do have is the same as visible on the old screenshot: Decimal scores are not detected as the winning score. (In the pic above 10 is marked as winner, not 20,5) Likely the same issue. I have a german phone, so also "," as decimal

Unfortunately, it's still not fixed after 3 years - is the app abandoned?
I have to always fix who wins when using decimal. But there is nothing I can do to fix the stats.