Boo script division bug?

item=10
print (“${item}” + 3)
/ /13

print (“${item}” + 0.001)
/ /10.001

print (“${item}” / 0.33)
//Operator ‘/’ cannot be used with a left hand side of type ‘string’ and a right hand side of type ‘double’.

print (item/0.001)
//Operator ‘/’ cannot be used with a left hand side of type ‘object’ and a right hand side of type ‘double’.

Boo script division bug?
Help~~~

No bug.

No, it’s 103. You’re just concatenating strings here, not performing arithmetic. Maybe you mean “print (”${item + 3}“)”, though you could just do “print (item + 3)” instead.

As the error says. You can’t perform arithmetic with strings.

You’ve defined “item” as an object, apparently. You can’t perform arithmetic with objects. It will work if you cast item to a number, or better yet just define item as a number in the first place:

	def Start ():
		item=10
		print (item/0.001)

–Eric

Thank you Eric5h5.
That My fault. Sorry!

Finally,I get the solution:

for item in [1, 2.0, "three"]:
	if item isa int:
		print (cast(int, item) + 3)
	elif item isa double:
		print (cast(double, item) / 0.03)
	elif item isa string:
		print (item.ToString().ToUpper())