scusa, ho visto ora che ti serve l'algoritmo contrario a quello che ti ho suggerito
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<script>
function currency2float(c) {
var re_currency = /^\d{1,3}(\.\d{3})*?,\d{1,2}$/;
if (!re_currency.test(c)) return 'not a currency';
return c.replace(/\./g, '').replace(/,/g, ".");
}
alert(currency2float('12.345,89'));
alert(currency2float('1.345.789,5'));
alert(currency2float('0,89'));
alert(currency2float('1.23,89'));
</script>
</head>