标签: javascript integer
如何将“570.581,88”转换为整数并进行相应排序?
答案 0 :(得分:12)
var s = "570.581,88"; // Format as American input s = s.replace(/\./g,'').replace(',','.'); // Integer var i = parseInt(s,10); // Floats var f1 = parseFloat(s); var f2 = s*1; var f3 = +s;