Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Math in Denmark

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?

Best Answer
0 Votes
8 REPLIES 8

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?

Best Answer
0 Votes

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.  🙂

 

Denmark.png

Best Answer
0 Votes

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 ?

Community Council MemberMario Dings | Rotterdam NL
Fitbit: Versa, Versa2, Sense. (Versa light) - Phone: Android. - Developer clockfaces.(Nederlands)
Best Answer
0 Votes

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. 

 

Best Answer
0 Votes

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.

Community Council MemberMario Dings | Rotterdam NL
Fitbit: Versa, Versa2, Sense. (Versa light) - Phone: Android. - Developer clockfaces.(Nederlands)
Best Answer
0 Votes

I do see a difference in the format on page 2.

in (nl-NL) I see no difference between decimal point and 1000 point

CCBE710A-34E1-4656-B9A9-1324AA23BC54.jpeg

 The arcs are still ok. 

 

Community Council MemberMario Dings | Rotterdam NL
Fitbit: Versa, Versa2, Sense. (Versa light) - Phone: Android. - Developer clockfaces.(Nederlands)
Best Answer
0 Votes

The formula is excellent

Best Answer
0 Votes

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?

I am also interested in solving the problem. Thank you for your inquiry.
 
Moderator Edit: Formatting
Best Answer
0 Votes