ScriptSpot

Forum topic · General Scripting

Spiner.value problem

By KemalAvdovic · 2007-06-08

Description

I have a problem or one could say i cant solve that problem :D.

 

for example: i want to divide the spinner value by 2, and i write it like d = spinner.value / 2

and it works great for numbers like 2, 4, 6, 8, 19, 22, but when i enter 3, 5, 7, 15, 17, it does nothing.

and i dont know how to seal with it!

Comments (4)

crazyosachou · 2007-10-14

Hi,
Man, u need just to tape :
"d = spinner.value / 2 as float"
Good LUCK.

kalimba · 2007-10-12

sorry wrong forum. i couldn't find how i can delete.

le1setreter · 2007-07-03

try to give the spinner the value of "2.000" and not "2". maybe you also can divide by 2.000 ...

JamesCG · 2007-06-10

I am horribly new to scripting but I will throw in my 2 cents.  It sounds like the default number type is integer here.  In other words only 1, 2, 3 etc.  So when it returns a number dividable by 2 no problem, but when you divide 3 by 2 you get 1.5, a fraction or floating point number.  Try setting it up  so that you can recieve floating point numbers and you should be ok (I have no idea how to do it, just starting here)

 

~ JamesCG