Question about km / mile

There is no Km/Mile in the conditional line. Is there a way to convert Km and Mile?

Since you can’t access Samsung Health directly there is no distance feature so no Mile/Kilometer options.
There is a topic in this community where other members have posted calculations to use step count to create distance for Mile or KM but you would need to use a tap action to change so one appears and the other one doesn’t. There are no Tags.

Ron
Samsung Developer Relations

Thank you for your answer.
To change one to display and the other to not display, how exactly should I set the tap action?

I used the [LANG_LOC] tag to decide whether to display miles or km. Basically if the [LANG_LOC] reflects US or UK, I set it to miles, otherwise it’s km. It’s probably not perfect, but it provides a level of automation.

The tag expression I use in the opacity field for miles is:

100*(([LANG_LOC]==“en_GB”)+([LANG_LOC]==“en_US”))

The km condition is just the inverse.

Hope this helps,

Rob

1 Like

Looks like LANG_LOC is not available in Opacity tags.

You’re right, it doesn’t appear in the tag list, but I just typed it in and it works.

Thank you very much.
Can you tell us how to express the tag for KM?

Just put an exclamation mark (boolean ‘NOT’ term) in front of the expression as shown below…

100*!(([LANG_LOC]==“en_GB”)+([LANG_LOC]==“en_US”))

I put this expression in Opacity for miles text: (([LANG_LOC]==“en_GB”)+([LANG_LOC]==“en_US”))? 100: 0

and this expression for km text: (([LANG_LOC]==“en_GB”)+([LANG_LOC]==“en_US”))? 0: 100

I am in the USA and it still shows km on my watch. Any idea what could be wrong? I tried setting the value to [LANG_LOC] and it shows en_US on my watch.

If I change the condition to ko_KR in watch face studio it works in the preview but it’s not working on my watch in USA.

1 Like

Your expressions are correct, but the problem is that the quote marks have been subtly altered, probably when I posted the formula into the forum. They seem to get converted into “smart quotes” which are different characters from regular quotes, so WFS will not be able to correctly interpret the formula.

Replace the quote marks in your opacity field tag expression with ones that are typed directly in at the keyboard and you should be good to go!

If you do not want inserted formulas to get affected by automatic forum formatting, then mark them as preformated text:

1 Like

Thank you rob1585568856, it worked.

Thanks Peter, Great tip. I’ll try to remember next time! :+1:

Hello! I am trying to put the expression you have shown above by changing the omillas but it does not work on my device or on the computer. Can you put the correct expression to check if I am making a mistake? Thanks

1 Like
100*(([LANG_LOC]=="en_GB")+([LANG_LOC]=="en_US"))

Ron

Thanks for the help, it works!

Hi i have used these tags
for KM 100*!(([LANG_LOC]=="en_GB")+([LANG_LOC]=="en_US"))
for MILES 100*(([LANG_LOC]=="en_GB")+([LANG_LOC]=="en_US"))
but on my watch it shows me Miles not KM despite LANG_LOC = en_GB
Screenshot_20220904_212247_sysui

Hi gmpanh,

The formula is working correctly. It is supposed to show miles when [LANG_LOC] is en_GB or en_US.

Rob

Ok, is it possible to make it KM when en_GB is selected as in UK people use KM not miles.

Hi, yes it’s possible to change the formula. You would just remove the test of en_GB from the fomula. But there is no need. The UK uses miles.

1 Like