function ToFloat(variable){
	if(variable.indexOf(',') != -1)
		variable = variable.replace(',','.');
	if(typeof(variable) == 'string'){
		return parseFloat(variable);	
	} else {
		return parseFloat(variable.toString());	
	}
}

function ToInteger(variable){
	if(typeof(variable) == 'string'){
		return parseInt(variable);	
	} else {
		return parseInt(variable.toString());	
	}
}

function ToCommaFloat(variable){
	var pos;
	if(typeof(variable) != 'string')
		variable = variable.toString();
	if(variable.indexOf(',') != -1)
		variable = variable.replace(',','.')
	if(pos = variable.indexOf('.') != -1){
		variable =  variable.replace('.',',').split(',');
		if(typeof(variable[1]) != 'undefined'){
			variable[1] = FloatRound(variable[1]);
			if(variable[1].length == 1){
				variable[1] += '0';	
			}
			return variable[0] + ',' + variable[1];
		} else {
			return variable[0];	
		}
	} else {
		return variable+',00';	
	}
}

function FloatRound(val){
	if(val.length > 2){
		var v1,v2;
		v1 = val.substr(0,2);
		v2 = val.substr(2,val.length);
		if(v2 > 5){
			v1 = v1+1;
			if(v1 > 99){
				val = val + 1;	
			}
		}
		return v1;
	} else {
		return val;	
	}
}