// moltiplica per cento arrotondando e trasforma in stringa
str = "" + Math.round(totcontrans * 100);
// aggiungi la virgola al punto giusto
str = str.substr(0,str.length-2)+","+str.substr(str.length-2);
alert(str)

ciao

ps: ti rimangono da gestire i numri inferiori a 1 ed i negativi... provaci