MultiTool Plugin - Remove Decimal?

Posted on
Mon Dec 30, 2019 2:34 pm
ckeyes888 offline
Posts: 2288
Joined: Nov 26, 2009
Location: Kalispell, MT

MultiTool Plugin - Remove Decimal?

Hey,

Can this tool be used to convert a variable value to an integer? e.g. 16.0 to 16

Thanks,

Carl

Posted on
Mon Dec 30, 2019 3:26 pm
DaveL17 offline
User avatar
Posts: 5944
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: MultiTool Plugin - Remove Decimal?

Hi Carl - no, the Multitool plugin doesn't have that capability. What you're looking to do can be done very simply using Python.

Code: Select all
x = indigo.variables[12345678].getValue(int)
What are you looking to do with the integer value once you get it?

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Dec 30, 2019 4:22 pm
howartp offline
Posts: 4281
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: MultiTool Plugin - Remove Decimal?

I was going to say, the EPS Device Extensionsplugin should do this for you.

Type: EPS Device Extensions
Model: Conversion Extension

Use device: Unchecked (which means it watches Variables not Devices)
Conversion: Convert String to Number
Convert to: Integer

However the plugin never actually displays any output in it's states when I tested it, so you might need to raise it with @Colarado4Wheeler if he's still around.

Posted on
Mon Dec 30, 2019 7:07 pm
DaveL17 offline
User avatar
Posts: 5944
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: MultiTool Plugin - Remove Decimal?

I haven't used the EPS plugin for some time, but that's another good suggestion.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Dec 30, 2019 7:11 pm
ckeyes888 offline
Posts: 2288
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: MultiTool Plugin - Remove Decimal?

DaveL17 wrote:
Hi Carl - no, the Multitool plugin doesn't have that capability. What you're looking to do can be done very simply using Python.

Code: Select all
x = indigo.variables[12345678].getValue(int)
What are you looking to do with the integer value once you get it?


I insert the moon phase state in the FW Astrology plugin to a variable.
Just need the number without the decimal.

Sorry, not sure how to use the script you posted.

Thanks,

Carl

Posted on
Mon Dec 30, 2019 7:17 pm
ckeyes888 offline
Posts: 2288
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: MultiTool Plugin - Remove Decimal?

DaveL17 wrote:
I haven't used the EPS plugin for some time, but that's another good suggestion.


Not seeing anything in the EPS Device Extensions plugin that might do that.

Thanks,

Carl

Posted on
Mon Dec 30, 2019 8:01 pm
ckeyes888 offline
Posts: 2288
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: MultiTool Plugin - Remove Decimal?

ckeyes888 wrote:
DaveL17 wrote:
I haven't used the EPS plugin for some time, but that's another good suggestion.


Any tips on using EPS Device Extensions would be appreciated. I created a DE device, tried
using both a device and variable but not sure how to trigger it or how it functions.

Thanks,

Carl

Posted on
Mon Dec 30, 2019 8:44 pm
DaveL17 offline
User avatar
Posts: 5944
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: MultiTool Plugin - Remove Decimal?

Actually, I did a quick test and I couldn't get it to work either. I'm thinking that feature may not be working properly.

Instead of inserting the moon phase into a variable and then converting it, why not convert it from the get go?

Code: Select all
moon_phase = int(indigo.devices[17807039].states['moonPhase'])
indigo.variable.updateValue(314742858, str(moon_phase))

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest