Kodi Community Forum

Full Version: Problem with "Integer.*" bools
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a widget container id 510 with static widget content.  One property on the content is the video rating that I get from service.skin.widgets.  It is formatted as "n.n"  I can display the label with no problem.  But when I test it with any test such as
Code:
Integer.IsGreater(container(510).listitem.property(videorating),0)
for example, it's always false.  Looking at the code in GUIInfoManager it seems like the string is first checked to see if it is an "nn:nn" time string and if not atoi(some_string) is called and the result tested against the supplied value.  IIUC, if for example the property value is stored as "6.7"  atoi("6.7") should return 6 as an integer and so Integer.IsGreater(this_property,0) should return true?  But I can't figure out a way to test this without running Kodi in a debugger.  I did mod the script so it returned a string that was an integer and that works, but I guess the only way to get it to work using n.n is to use String.StartsWith (works here since it only runs 0-10) but that seems sort of inelegant.

scott s.
.