Settings being saved as float not int
#1
Has anyone encountered this before?

The Settings XML file has this entry which explicitly demands the data be stored as an integer:

<setting id="length" label="32031" type="slider" default="5" range="1,1,50" option="int" />

But when the code in the addon tries to int(that_setting) it returns an "invalid literal for int() with base 10:" error.

Deleting the userdata/addon_data/addon/settings.xml file and then recreating it, doesnt solve the problem.

Original Post: http://forum.xbmc.org/showthread.php?tid...pid1740907

Thanks.
Reply
#2
(2014-06-25, 01:58)Karnagious Wrote: Has anyone encountered this before?

The Settings XML file has this entry which explicitly demands the data be stored as an integer:

<setting id="length" label="32031" type="slider" default="5" range="1,1,50" option="int" />

But when the code in the addon tries to int(that_setting) it returns an "invalid literal for int() with base 10:" error.

Deleting the userdata/addon_data/addon/settings.xml file and then recreating it, doesnt solve the problem.

Original Post: http://forum.xbmc.org/showthread.php?tid...pid1740907

Thanks.

Settings have always been saved as floats. You need to do a
Code:
int( float( __addon__.getSetting( "" ) ) )
Reply
#3
Ah, I just saw the note on the wiki. Thanks very muchly.

So it is just the SLIDER that stores as a float, right?
Reply
#4
(2014-06-26, 02:12)Karnagious Wrote: Ah, I just saw the note on the wiki. Thanks very muchly.

So it is just the SLIDER that stores as a float, right?

I think normal Integer settings are stored as an integer. Everything is stored as a string really. I treat every integer the same way, just in case they change something.
Reply

Logout Mark Read Team Forum Stats Members Help
Settings being saved as float not int0