function convert_measure(from,to,num) {
	switch(from) {
		case "mm":
			switch(to) {
				case "inch":
						return Math.round((num*Math.pow(10,2))/25.4)/Math.pow(10,2);
						//return Math.round((num*Math.pow(10,accuracy))/25.4)/Math.pow(10,accuracy);
					break;
			}
			break;
		case "cm":
			switch(to) {
				case "inch":
						return Math.round((num*Math.pow(10,2))/2.54)/Math.pow(10,2);
						//return Math.round((num*Math.pow(10,accuracy))/2.54)/Math.pow(10,accuracy);
					break;
			}
			break;
		case "inch":
			switch(to) {
				case "mm":
						return Math.round(num*25.4*Math.pow(10,1))/Math.pow(10,1);
						//return Math.round(num*25.4*Math.pow(10,accuracy))/Math.pow(10,accuracy);
					break;
				case "cm":
						return Math.round(num*2.54*Math.pow(10,2))/Math.pow(10,2);
						//return Math.round(num*2.54*Math.pow(10,accuracy))/Math.pow(10,accuracy);
					break;
				case "inch":
						return num;
						//return Math.round(num*2.54*Math.pow(10,accuracy))/Math.pow(10,accuracy);
					break;	
			}
			break;
	}
}
