I believe there is an MCStringToInteger method you could use here.