See past threads on how floating point numbers work. Use toPrecision or toFixed to convert the Number to String
hi Flex harUI,
Thanks for your repond.
I can fix this problem but I want to know why the result is 1.7763568394002505E-15. can you explain for me ?
So it's a tiny number, almost zero but not quite.
Binary nubers aren't always able to represent floating point values precisely.
It's not actionscript specific - it applies to computers in general.
Floating point numbers are stored in binary. The fractional bits represent 1/2, 1/4, 1/8, etc. not, 1/10, 1/100, 1/1000. A decimal number like 4.2 cannot be stored exactly in binary, because in binary 0.2 has an infinite repeating sequence of binary fractional digits. Think about trying to represent 1/5 when all you've got to work with is 1/2, 1/4, 1/8, etc.