Kodi Community Forum

Full Version: Formatting numbers?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Is it possible to format numbers in skins?

Specifically, I'd like to have "Chapter 3 / 12" and not "Chapter 03 / 12". Player.Chapter infolabel returns the chapter number formatted with two digits, I'd like to just get the raw number.
Variables would be the way to go.

ie

PHP Code:
<variable name="PlayerChapter">
    <
value condition="StringCompare(Player.Chapter,01)">$NUM[1]</value>
    <
value condition="StringCompare(Player.Chapter,02)">$NUM[2]</value>
    <
value condition="StringCompare(Player.Chapter,03)">$NUM[3]</value>
    <
value condition="StringCompare(Player.Chapter,04)">$NUM[4]</value>
    <
value condition="StringCompare(Player.Chapter,05)">$NUM[5]</value>
    <
value condition="StringCompare(Player.Chapter,06)">$NUM[6]</value>
    <
value condition="StringCompare(Player.Chapter,07)">$NUM[7]</value>
    <
value condition="StringCompare(Player.Chapter,08)">$NUM[8]</value>
    <
value condition="StringCompare(Player.Chapter,09)">$NUM[9]</value>
    <
value>$INFO[Player.Chapter]</value>
</
variable

Then replace $INFO[Player.Chapter] with $VAR[PlayerChapter].
Yeah, that works. Thanks, Hitcher.