ko.extenders.numeric = function(target,precision)
{
	var result = ko.computed(
	{
		read: target,
		write: function(value)
		{
			if(value)
			{
				var current = target();
				var value=isNaN(value)?'':value;
				var valor=value;
				if(_.isString(value) && value.indexOf('.')!=-1)
				{
					valor = parseFloat(value.replace(' ','').replace(/[^0-9\.]+/g,"")).toFixed(2);
					var valueToWrite=isNaN(valor)?'':valor;
					if (valueToWrite !== current) 
					{
						target(valueToWrite);
						target.notifySubscribers(valueToWrite);
					}else{
						if(isNaN(valueToWrite) || !valueToWrite)
						{
							target(valueToWrite);
							target.notifySubscribers(valueToWrite);	
						}
					}
				}else{
					valor = parseInt(value.replace(' ','').replace(/\D/g,""));
					var valueToWrite=isNaN(valor)?'':valor;
					if (valueToWrite !== current) 
					{
						target(valueToWrite);
						target.notifySubscribers(valueToWrite);
					}else{
						if(isNaN(valueToWrite) || !valueToWrite)
						{
							target(valueToWrite);
							target.notifySubscribers(valueToWrite);	
						}
					}
				}
			}else{
				target('');
				target.notifySubscribers();
			}
		}
	});
	result(target());
	return result;
};