(function() { var t = "1,22"; var firstNum = parseFloat(t); var secondNum = t.replace(firstNum+',',''); alert(firstNum); alert(secondNum); })();