how can i conve开发者_JAVA技巧rt "570.581,88" into an integer and sort accordingly?
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;
精彩评论