Time formatting.
#1
Through a set of value conditions I'd like to present the remaining time formatted for what would be more commonly written/read, and this has worked great thus far with the exception of leading zeros.

I've currently had success with this in the hours display, changing (hh) to (h).. hence "01 hour remaining" to "1 hour remaining"

However with minutes and seconds, this does not work... changing (mm) to (m) yields a change from "05 minutes remaining" to "05:42 minutes remaining" ..

Anyway I can achieve the desired effect?

Thanks for any help you can provide.
Reply
#2
not sure if it works, but give this a shot:

Code:
<label>$VAR[TimeRemain]</label>

<variable name="TimeRemain">
    <value condition="StringCompare(Player.TimeRemaining(mm),00)">0</value>
    ...
    <value condition="StringCompare(Player.TimeRemaining(mm),09)">9</value>
    <value>$INFO[Player.TimeRemaining(mm)]</value>
</variable>


edit:
you probably need to format* it like:
<value condition="StringCompare(Player.TimeRemaining(mm),09)">$NUMBER[9]</value>

*only supported in gotham
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Works perfectly, thank you ronie.
Reply

Logout Mark Read Team Forum Stats Members Help
Time formatting.0