Force an Integer?

Posted on
Sun Dec 22, 2019 8:19 pm
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Force an Integer?

Hi,

Just trying to get this script to insert an integer. Currently it's inserting a decimal as well. e.g. 65.0
Cant seem to change the bit of code that will insert it as just 65
Code: Select all
new_string = "stat_{}".format(
    indigo.variables["TstatLivingRoomSet"].value,   
)
indigo.variable.updateValue( "Photos", new_string)

I assume it uses .getvalue(int) somehow?

Thanks,

Carl

Posted on
Sun Dec 22, 2019 8:30 pm
FlyingDiver offline
User avatar
Posts: 7222
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Force an Integer?

Code: Select all
new_string = "stat_{}".format(indigo.variables["TstatLivingRoomSet"].getValue(int))
indigo.variable.updateValue( "Photos", new_string)

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sun Dec 22, 2019 8:42 pm
ckeyes888 offline
Posts: 2425
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: Force an Integer?

Thanks. Works great.

Carl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 13 guests

cron