> At least when working with XML, I have found Number() to be fairly
> inconsistent in converting strings to numbers. parseInt() seems to work
> everytime.
How exactly? An example would be good.
I find Number a lot more suitable and correct i.e. the aim is to
_convert_/_cast_ a string into a number. I don't want to _parse_ the
number out of a string.
e.g.
Number("1a") will return NaN.
parseInt("1a") will return 1.
Number("1 ") will return NaN.
parseInt("1 ") will return 1.
So.. Number():
a) doesn't mangle the data
b) depends on valid input - no whitespace etc.
c) is faster
-K
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders