Number.prototype.signe_decimal = ",";
			
function formater(nombre, taille) {
	if (isNaN(nombre)) return "";
	var chaine = nombre.toString();
	while (chaine.length < taille) chaine = "0" + chaine;
	return chaine;
}

function arrondir(nombre, decimales) {
	if (isNaN(nombre)) return "";
	if (decimales == 0) {
		var n = Math.round(nombre);
		return n.toString();
	}
	else if (decimales > 0) {
		if (document.all) var undefined; // Netscape 4 ne connaît pas la constante "undefined" 
		var p10 = Math.pow(10, decimales);
		var n = Math.round(nombre * p10); 
		n = n.toString();
		var point = n.length - decimales;					
		if (point >= 0) n = n.substring(0, point) + "." + n.substring(point);
		else n = "0." + formater(n, decimales);
	}
	else {
		var p10 = Math.pow(10, -decimales);
		var n = Math.round(nombre / p10) * p10;
		n = n.toString();
	}
	
	if (nombre.signe_decimal == undefined) return n;
	else return n.replace(".", nombre.signe_decimal);
}

function arrondir2(nombre){
	return arrondir(nombre,2);
}