Convert string to number

is there a way to convert a string to a number? i have a number stored in an xml document and when i try to access it, it comes across as a string, or something thats not a number (it returns 0 when i trace the attribute, not NaN, so i’m not sure exactly what it’s doing).