Distance calculation in Km

Using the following formula, posted by another colleague on this forum:


I try to calculate and show the distance traveled in km. It has worked well until today, when I have walked more than usual and what happens to me is that when the steps exceed a certain number, the whole part goes from 9 to 0, disappearing the 1 of 10. Specifically in step 13124. What I see is:

step 13123 → 9.99 Km
step 13124 → 0.00 Km

and from here begins a new count 0.01 - 0.02 … which I understand is because the 1 of the tens disappears.

Someone else happens? What am I doing wrong?

Thank you all very much for this great forum and greetings.

This is the correct formula:


1 Like

It works!!!

Many thanks.

Guys, where do you need to put this formula so that the counting of steps in km works? “Tags” - not working


In a component of type text, in ‘Text Field’


1 Like

This is the not correct formula. Not working. :frowning_face:

Taking into account that it is an approximate calculation because you manually enter the length of the road (0.762 m), it works for me.

As you can see in the graph, it tells me that 15000 steps are 11.43 km.

InkedCaptura 1_LI

1 Like


This formula really works, have it implemented in my watchfaces;) Bold font shows the error of the original.

0.745 = length of my step in [m]

Now its ok - working.

thanks for sharing, I try it and work well

Not working :roll_eyes:

Try this:
(([SC]*0.00475)*1%1>=0.5?([SC]*0.000475)+0.1-([SC]*0.00475)*1%1/10:([SC]*0.000475)-([SC]*0.00475)*1%1/10) mile


Chrome copy-paste does not work well. In the end, the formula worked. Thanks!


From this posts, I can select km/mile like below.
Could you please confirm this is right fomula?

((([SC]*0.745)-([SC]*0.745)%1000)/1000% 100 ).((([SC]*0.745)%1000-([SC]*0.745)%100)/100)((([SC]*0.745)%100-([SC]*0.745)%10)/10)


+one more thing

Can I distinguish km/mile by users’ setting?