I was comparing 2 numerical values in my vortex script and came around with this strange issue that there is a difference in comparison when I compare a 3 digit number with a 3 digit number and when I compare the same 3 digit number with a four digit number.
For example:
Scenario 1 : (comparing 3 digit number with 4 digit number)
The example code is as follows :
<strfmt "%d" $age><$age=$ret>Age:$age
<strfmt "%d" $no_of_downloads><$no_of_downloads=$ret>dwnd:$no_of_downloads
<if $no_of_downloads lt 1000>
Hello 1
</if>
<if $age le 1000 >
Hello 2
</if>
Output :
Age:761
dwnd:526
Scenario 2: (comparing 3 digit number with 3 digit number)
The example code is as follows :
<strfmt "%d" $age><$age=$ret>Age:$age
<strfmt "%d" $no_of_downloads><$no_of_downloads=$ret>dwnd:$no_of_downloads
<if $no_of_downloads lt 999>
Hello 1
</if>
<if $age le 999 >
Hello 2
</if>
Output :
Age:761
dwnd:526
Hello 1
Hello 2
Scenario 3:
The example code is as follows :
<strfmt "%d" $age><$age=$ret>Age:$age
<strfmt "%d" $no_of_downloads><$no_of_downloads=$ret>dwnd:$no_of_downloads
<if $no_of_downloads lt 1000>
Hello 1
</if>
<if $age le 999 >
Hello 2
</if>
Output :
Age:761
dwnd:526
Hello 2
This same kind of thing happened when I tried with 2 digit and 3 digit numbers.
Could anyone please suggest a better way to handle such scenarios.
For example:
Scenario 1 : (comparing 3 digit number with 4 digit number)
The example code is as follows :
<strfmt "%d" $age><$age=$ret>Age:$age
<strfmt "%d" $no_of_downloads><$no_of_downloads=$ret>dwnd:$no_of_downloads
<if $no_of_downloads lt 1000>
Hello 1
</if>
<if $age le 1000 >
Hello 2
</if>
Output :
Age:761
dwnd:526
Scenario 2: (comparing 3 digit number with 3 digit number)
The example code is as follows :
<strfmt "%d" $age><$age=$ret>Age:$age
<strfmt "%d" $no_of_downloads><$no_of_downloads=$ret>dwnd:$no_of_downloads
<if $no_of_downloads lt 999>
Hello 1
</if>
<if $age le 999 >
Hello 2
</if>
Output :
Age:761
dwnd:526
Hello 1
Hello 2
Scenario 3:
The example code is as follows :
<strfmt "%d" $age><$age=$ret>Age:$age
<strfmt "%d" $no_of_downloads><$no_of_downloads=$ret>dwnd:$no_of_downloads
<if $no_of_downloads lt 1000>
Hello 1
</if>
<if $age le 999 >
Hello 2
</if>
Output :
Age:761
dwnd:526
Hello 2
This same kind of thing happened when I tried with 2 digit and 3 digit numbers.
Could anyone please suggest a better way to handle such scenarios.