function formatNumbers(expr, decplaces)
	{
		// evaluate the incoming expression
		var val = eval(expr);
		// raise the value by power of 10 times the number of decimal places;
		// round to an integer; convert to string
		var str = "" + Math.round(val * Math.pow(10, decplaces));
		// pad small value strings with zeros to the left of rounded number
		while (str.length <= decplaces)
		{
		str = "0" + str;
		}
		// establish location of decimal point
		var decpoint = str.length - decplaces;	
		
		// assemble final result from:
		// (a) the string up to the position of the decimal point;
		// (b) the decimal point; and
		// (c) the balance of the string. Return finished product.
		return str.substring(0,decpoint) + "." + str.substring(decpoint, str.length);
	}
// generic positive number decimal formatting function

generic positive number decimal formatting function
generic positive number decimal formatting function
function formatNumbers(expr, decplaces)
	{
		var val = eval(expr);
		var str = "" + Math.round(val * Math.pow(10, decplaces));
		while (str.length <= decplaces)
		{
		str = "0" + str;
		}
		var decpoint = str.length - decplaces;	
		return str.substring(0,decpoint) + "." + str.substring(decpoint, str.length);
	}
function formatNumbers ( expr , decplaces ) { var val = eval ( expr ) ; var str = "" + Math . round ( val * Math . pow ( 10 , decplaces ) ) ; while ( str . length <= decplaces ) { str = "0" + str ; } var decpoint = str . length - decplaces ; return str . substring ( 0 , decpoint ) + "." + str . substring ( decpoint , str . length ) ; }
generic positive number decimal formatting function
generic positive number decimal formatting function
// evaluate the incoming expression
 // raise the value by power of 10 times the number of decimal places;
 // round to an integer; convert to string
 // pad small value strings with zeros to the left of rounded number
 // establish location of decimal point
 // assemble final result from:
 // (a) the string up to the position of the decimal point;
 // (b) the decimal point; and
 // (c) the balance of the string. Return finished product.
