You can convert strings of numeric characters to actual Number data using Number (). The way it works is that you pass the String value to Number (), and in turn, this will create the version of the String number that was passed to it.
trace(Number("1")/Number("2"));
NaN is the result because you are trying to convert String data to be used as number data.
You need to follow this up because the "/" operator is not a number. You can only multiply or divide numbers, not strings. So, during the process of dividing String data, we implicitly force the values ββto change to numerical data. We cannot do this. We must first convert the String data to numeric data, and then perform an arithmetic operation.
source share