Page 1 of 1

MultiTool Plugin - Remove Decimal?

PostPosted: Mon Dec 30, 2019 2:34 pm
by ckeyes888
Hey,

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

Thanks,

Carl

Re: MultiTool Plugin - Remove Decimal?

PostPosted: Mon Dec 30, 2019 3:26 pm
by DaveL17
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?

Re: MultiTool Plugin - Remove Decimal?

PostPosted: Mon Dec 30, 2019 4:22 pm
by howartp
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.

Re: MultiTool Plugin - Remove Decimal?

PostPosted: Mon Dec 30, 2019 7:07 pm
by DaveL17
I haven't used the EPS plugin for some time, but that's another good suggestion.

Re: MultiTool Plugin - Remove Decimal?

PostPosted: Mon Dec 30, 2019 7:11 pm
by ckeyes888
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

Re: MultiTool Plugin - Remove Decimal?

PostPosted: Mon Dec 30, 2019 7:17 pm
by ckeyes888
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

Re: MultiTool Plugin - Remove Decimal?

PostPosted: Mon Dec 30, 2019 8:01 pm
by ckeyes888
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

Re: MultiTool Plugin - Remove Decimal?

PostPosted: Mon Dec 30, 2019 8:44 pm
by DaveL17
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))