toNum method

num toNum()

Implementation

num toNum(){
  try{
    return num.parse(str());
  }catch(e){
    return -1;
  }
}