08-20-2020 08:49
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-20-2020 08:49
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I got an email from a customer in Denmark who is having issues with the statistic arc calculations.
Apparently in Denmark, commas are used like periods in the US, so ten thousand is written 10.000 instead of 10,000. The same for decimals so 1.5 in the US would be 1,5 in Denmark.
Here is my code used to calculate the steps and arc.
//********** CALCULATE STEPS **********\\
let localSteps = (today.adjusted.steps.toLocaleString() || 0);
var steps = document.getElementById("steps");
steps.text = (localSteps);
//********** CALCULATE STEPS ARC **********\\
let stepsCalc = (Math.floor((today.local.steps/goals.steps) * 310));
var stepsArc = document.getElementById("stepsArc");
if (stepsCalc > 310) {
stepsArc.sweepAngle = 310;
} else {
stepsArc.sweepAngle = stepsCalc;
}
The customer had a step goal of 6000 and had 4100 steps for the day, but instead of the arc being at 2/3 it was just barely showing at all.
I have verified that the today.adjusted.steps and the today.local.steps are both raw numbers and no commas in the calculation.
Has anyone else seen this?

09-02-2020 07:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


09-02-2020 07:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
It looks sane to me. Was the text field showing the correct value, but the arc was flat?
Is there a reason you're using adjusted for the text and local for the arc?
Perhaps add a permissions check to ensure they've actually granted access to user activity data?

09-02-2020 09:55 - edited 09-02-2020 09:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-02-2020 09:55 - edited 09-02-2020 09:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Here is the screenshot sent to me. The text field is correct and you can see that the arc is starting. The step goal is 6000. If you do the math with the 4,103 as 4.1 the arc display would be correct. However the data used is raw data. No reason to use the adjusted. Just something that perpetuated and has been overlooked. 🙂

09-08-2020 14:24
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


09-08-2020 14:24
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Math is universal. Never seen this before. I think (like Jon) it’s to do with permissions.
What clockface are you talking about?
do you use locale ?
Fitbit: Versa, Versa2, Sense. (Versa light) - Phone: Android. - Developer clockfaces.(Nederlands)

09-09-2020 07:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

09-09-2020 07:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I would assume that math is universal also. I am having them toggle all the permissions, however I would challenge that because the stats are all being collected which would not happen if they didn't have permission.
The clockface in question is Easy Read 101, however I have had this person download others and got the same result.

09-09-2020 14:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


09-09-2020 14:16
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I’m going to test it.
First impression: a very good looking clockface. Nice work!
no fault in the arc, no fault in the numbers (12.367 of 11.000).
Yes, dot for thousands, komma for decimals.
Oeps, komma for thousands, location is set to USA.
Back to Danmark.
more next time.
Fitbit: Versa, Versa2, Sense. (Versa light) - Phone: Android. - Developer clockfaces.(Nederlands)

09-10-2020 11:12 - edited 09-10-2020 15:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


09-10-2020 11:12 - edited 09-10-2020 15:31
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I do see a difference in the format on page 2.
in (nl-NL) I see no difference between decimal point and 1000 point
The arcs are still ok.
Fitbit: Versa, Versa2, Sense. (Versa light) - Phone: Android. - Developer clockfaces.(Nederlands)

02-17-2021 08:32
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

02-17-2021 08:32
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
The formula is excellent

07-23-2021
02:35
- last edited on
12-14-2021
21:15
by
YojanaFitbit
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

07-23-2021
02:35
- last edited on
12-14-2021
21:15
by
YojanaFitbit
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I got an email from a customer in Denmark who is having issues with the statistic arc calculations.
Apparently in Denmark, commas are used like periods in the US, so ten thousand is written 10.000 instead of 10,000. The same for decimals so 1.5 in the US would be 1,5 in Denmark.
Here is my code used to calculate the steps and arc.
//********** CALCULATE STEPS **********\\
let localSteps = (today.adjusted.steps.toLocaleString() || 0);
var steps = document.getElementById("steps");
steps.text = (localSteps);
//********** CALCULATE STEPS ARC **********\\
let stepsCalc = (Math.floor((today.local.steps/goals.steps) * 310));
var stepsArc = document.getElementById("stepsArc");
if (stepsCalc > 310) {
stepsArc.sweepAngle = 310;
} else {
stepsArc.sweepAngle = stepsCalc;
}
The customer had a step goal of 6000 and had 4100 steps for the day, but instead of the arc being at 2/3 it was just barely showing at all.
I saw some solutions to this problem on the site where the specialists who work there showed me a partial solution to this problem. When it comes to statistics and performing tasks on statistics, I always turn to this resource.
I have verified that the today.adjusted.steps and the today.local.steps are both raw numbers and no commas in the calculation.
Has anyone else seen this?

