var i = 1201.59; var re = /(?=\B(?:\d{3})+(?!\d))/g; var j = i.toString().replace( re, ' ' ).replace('.', ','); alert(j)