
function fdp(n,d){
	if (n==0){
		theNo = '0.';
		for (theCount=0;theCount<d;theCount+=1) {
			theNo = theNo + '0';
		}
	} else {
		theNeg = '';
		theNo=n*Math.pow(10,d);
		theNo=Math.round(theNo);
		if (theNo<0) {
			theNeg='-';
			theNo=theNo*-1;
		}
		if (theNo==0){
			theNo = '0';
			for (theCount=0;theCount<d;theCount+=1) {
				theNo = theNo + '0';
			}
		} 
		theNo = theNo.toString();
		if (theNo.length<d) {
			for (theCount=theNo.length;theCount<d;theCount+=1) {
				theNo = "0"+theNo;
			}
		}
		theNo = theNeg+theNo.substr(0,theNo.length-d)+"."+theNo.substr(theNo.length-d,theNo.length);
	}
}

