Posts: 3,746
Joined: May 2004
Reputation:
20
Livin
Posting Freak
Posts: 3,746
i have a simple way in vb to convert any number into a integer multiple of 10
v = int(v/10)*10
but this does not work in python.
the error tells me that the '/' is not allowed.
so i tried int((v/10)) but no workie.
help please!
:nuts:
I'm not an expert but I play one at work.
Posts: 928
Joined: Feb 2004
Reputation:
0
Asteron
"Skilled" Python Coder
Posts: 928
it is saying that you can't divide a str by and int.
the parameter you are passing in for v is a str.
if v is something like '100' (a string that looks like a number) do
v = "dims" + str(int(parseint(v)/10)*10) + ".gif"
i don't know what & does to strings but you probably want + instead.
Posts: 928
Joined: Feb 2004
Reputation:
0
Asteron
"Skilled" Python Coder
Posts: 928
haha sorry i was thinking javascript.
v = "dims" + str((int(v)/10)*10) + ".gif"
will be fine. no need to cast the division back into an int since this is integer arithmetic.