Leading Zero on LUA

Hi Guys

I am trying to put a leading Zero on {bl} . I am not that Familiar with Lua and find it more counter intuitive than other Syntax . Aso is there a recommended entry level LUA Tutorial . I can say at this stage that I have found AI no use for generating LUA conditionals . I got one sync on my publication and sadly no comment . I don’t see a lot of comments on WM Faces . Shame .

Thanks in advance .

.

Try this (3 separate layers:
B1st place:
({bl}-(10*(math.floor({bl}/10))))
B10th place:
(math.floor({bl}/10))
B100th place:
((math.floor({bl}/100))-((math.floor({bl}/1000))*10))

This might be helpful:

Also, I am not sure how much Lua is supported in Watch Face Format. Maybe someone can shed some light on the limitations for WearOS 6 / WFF ?

Provided by M8urnett

Wow . Lots to look at there thank you Very Much . I shall make a Folder with all that stuff in . I was hoping for a One line conditional like ones I have used on Facer but this is the line I was given by AI and it did not work . I wondered if there was a way to make that conditional work .

I Thank you for your response and at the same time thank you for your contribution on the Facer Community .

{bl} < 10 and “0” .. {bl} or {bl}

For 1 line use ..
E.g.
(math.floor({bl}/10))..({bl}-(10*(math.floor({bl}/10))))

It does not work for me with 3 joins, only 2.

I enjoy contributing on both Watchmaker and Facer communities. Sharing is caring!

Thanks so much fo that but I am still not getting the leading Zero from that . At the end of the day Not many will let their watch battery run under 10% . I will have a look at the Tutorials and se if I can Learn a bit of LUA .

.

I had a very interesting chat with Gemini . Tried load of one liners that did not work . Settled on a Two line solution . So that is how it will be done .

For the opacity of the Leading Zero .

({bl} < 10) and 100 or 0

then

{bl}

on line 2 justified to the right .

I have never used Gemini before . We MIght chat again .

Thank for the help . Much appreciated

(‘{bl}’ < ‘10’ and ‘0’ or ‘’) .. ‘{bl}’

Try that. I am not sure if this will work because my level is now 89. Let me know pls. I’am intrested in your result

Hi @AndrewChurcher . Thanks for your input . That formula shows nothing on the editor . I see no point in sending it to my watch . Gemini said there was some Aggressive Syntax rule that will not allow a leading Zero in text .

The editor does not always show exactly same as watch, so sending to watch is worthwhile as it may show different results. If you spot any such issues, report them and they are quickly resolved.

Thank you. I always shy away from stuff that does not show on the Editor. But I will give it a go tomorrow. I know Alex is very busy with some more important stuff than leading Zero and I have an elegant solution that taught me a bit of Lua. I am extremely happy with the Editor and and this Forum. Thanks again.

I found this works on my Samsung watch ultra
Leading zero 3 digits
string.format(“%03d”, {bl})

Leading zero 2 digits
string.format(“%02d”, {bl})

Note: does not display leading zero in studio, but does on watch.