Here is the shortest solution that will work an all given examples. I check for the third to last character, and if its comma or dot I assume it as an integer separator.
function parse(source) {
var sep = source.charAt(source.length - 3);
switch (sep) {
case '.':
case ',':
var parts = source.split(sep);
var norm = parts[0].replace(/(\.|,|\s)/g, '') + '.' + parts[1];
break;
default:
var norm = source.replace(/(\.|,|\s)/g, '');
}
return Math.round(Number(norm));
}
Demo: http://jsfiddle.net/5C4aN/2/
Also have a look on accounting.js which does good job formatting/parsing currencies.