sourceuno
Posts: 225 Joined: Mon Apr 09, 2001 3:58 pm
Post
by sourceuno » Mon May 21, 2001 6:20 pm
How do I convert a string to an integer in order to perform some integer arithmetic? When I use the following statements, the $newval variable equals 455. Why doesn't it equal 45?
<$intValue=500>
<$str="tagid=455">
<sandr "tagid\==" "" $str>
<$newval=($ret - $intValue)>
$newval
John
Site Admin
Posts: 2622 Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:
Post
by John » Mon May 21, 2001 9:45 pm
The result of the <sandr> is a string. You can convert
it to an integer in your expression as follows:
<$newval=(convert($ret, 'int' ) - $intValue)>
There is also the <strtonum> function in vortex which will convert strings in many formats into numbers.
John Turnbull
Thunderstone Software