Thread: Level: None
View Single Post
  #22  
Unread 12-07-2010, 12:04 AM
EQAditu's Avatar
EQAditu EQAditu is offline
A Griffon
Interface Author - Click to view interfaces
 
Join Date: Mar 2005
Server: Permafrost
Posts: 256
Default

Usually something like that would require string operations which we do not have, but you can probably use int() to get it right.

val -> "20 (43)"
int(val) -> 2043 (maybe)
val / 100 -> 20.43
int(val) -> 20


Though we would only want the 3rd line to happen if val > 100. So I guess something like...

val=int(val)
OVER=val > 100
val2=val / 100
val=OVER ? val2 : val
val=int(val)
Reply With Quote