• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

Greater and Less than in flash

Ok not sure how to ask this but here goes, in flash I have variables that are numbers and the I try to use a statement using greater then it works perfect when you have a number with two digets like 88 is greater than 80 that works but if I have 88 and the next number is a three digit number like 103 it shows 88 being greater. Exapmle below:
102 and 90 flash is showing 90 to be greater or 90 and 97 it will show 97 it just screws up when a number has three digits.
0
ucohockey
Asked:
ucohockey
1 Solution
 
quizengineCommented:
I think your numbers are not numbers, but strings. This is very likely if they are imported from an external file. You can *force* them to become numbers like this...

myVar = Number(myVar);

Try doing that to each of your variables and then compare them and see what's changed.
0
 
blue-genieCommented:
yeah i'd say the same.

to check do a typeof

i.e trace(typeof variablename) - will tell you if its a String or not.
0
 
ucohockeyAuthor Commented:
No it is a string I will try that thanks for the help.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now