How to cut off decimals in IMDB rating?
#1
Hey guys,

I am using this code to show the imdb rating:

Code:
<label>Rating: [color=Grey2]$INFO[Window.Property(LatestMovie.1.Rating)][/color]</label>

However it shows 6 decimals, like 7.800000. How can i cut off the decimals?

Thanx for the help!
Reply
#2
Lots of these -

PHP Code:
<control type="label">
    <
label>1.0</label>
    <
visible>SubString(Window.Property(LatestMovie.1.Rating),1.0)</visible>
</
control

Unless the script can be changed to only pull up to the first decimal point from the database.
Reply
#3
Change line 205 in the recentlyadded script from

Code:
self.WINDOW.setProperty( "LatestMovie.%d.Rating" % ( count + 1, ), [b]fields[ 7 ][/b] )

to

Code:
self.WINDOW.setProperty( "LatestMovie.%d.Rating" % ( count + 1, ), [b]"%.1f" % float(fields[ 7 ])[/b] )

I think this should be permanently changed because XBMC shows also only 1 decimal in the library.
Image
Reply
#4
Cheers Black.
Reply
#5
I've also added this the episodes and will get it changed for the randomitems script as well.
Reply
#6
Probably a stupid question, but does that mean i don't have to solve it within the skin code? Smile
Reply
#7
Sinvida Wrote:Probably a stupid question, but does that mean i don't have to solve it within the skin code? Smile

Either swap the code 'Black posted or wait a couple days till Hitcher pushes a fix. So yes, other than waiting theres nothing for you to do code wise...
Image

Check out The Carmichael - A Skin For XBMC

Check out Night - A Skin For XBMC

Check out Unfinished - A Skin For XBMC
Reply
#8
Both scripts should be updated shortly.
Reply
#9
Great, thanks!
Reply

Logout Mark Read Team Forum Stats Members Help
How to cut off decimals in IMDB rating?0