Ciao blekm,
Ti posto una estensione delle stringhe e dei numeri che avevo fatto tempo fa per la conversione in euro.
Codice PHP:Number.prototype.toEuro=function()
{
num=Math.round(parseFloat(this)*100)/100;
num=""+num;
if(num.indexOf(".") == -1)
{
num=num+".00";
}
else
{
var splitted=num.split(".");
if(splitted[1].length < 2)splitted[1]=splitted[1]+"0";
num=splitted[0]+"."+splitted[1];
}
return num;
}
String.prototype.toEuro=Number.prototype.toEuro;

Rispondi quotando