sostituisci
function dp(prezzo)
{
string = "" + prezzo;


con
function dp(prezzo)
{
string = "" + prezzo.replace( /,/g, '.' );