<!-- part of functionlibrary.txt// Currency Sign, Commas and 2 decimal place accuracy// Modified Sa 19 Jan 02 to add padding that right justifies calculated results in field// Modified by Matt Weilert, mew@skerja.net// Rock Eel Café, www.skerja.netfunction formatDollar(nValue) {    var sDollars = ""    var outDollars = ""    var sValue = new String(nValue)             //convert value to string    var decimalPos = sValue.indexOf(".")        //find position of decimal in the string    if (decimalPos == -1) decimalPos = sValue.length //if there is no decimal point    var dollars = sValue.substring(0,decimalPos) //digits of whole dollars    var dolLen = dollars.length                 //the lenght of the dollars string    //Add commas before each group of three digits (if any).    if (dolLen > 3) {        while (dolLen > 0) {            var tDollars = dollars.substring(dolLen-3,dolLen) //take last three digits, if any            if (tDollars.length == 3) {                 //if there are 3 digits in the portion                outDollars = "," + tDollars + outDollars //ad to comma and append other digits with commas                dolLen = dolLen - 3                     //lessen the left portion by 3 digits            }            else {                outDollars = tDollars + outDollars      //no comma if less than 3 digits left                dolLen = 0                      //stop the process            }        }        //Get rid of the leading comma (if any)        if (outDollars.substring(0,1) == ",")           //if the first character is ","            dollars = outDollars.substring(1,outDollars.length) //start with the next character        else            dollars = outDollars    }    //add $ at the begining and two cents digits at the end    var cents = sValue.substring(decimalPos + 1, decimalPos + 3) //take 2 digits after "." (no rounding)    if (cents.length == 1) cents = cents + "0"          //if only one cents digit    else if (cents.length == 0) cents = cents + "00"    //if no cents digits    var formatStr = "$" + dollars + "." + cents         //compose the output string    return formatStr}function padTextPrefix (InString, PadChar, DefLength)  {	if (InString.length>=DefLength)		return (InString);	OutString=InString	for (Count=InString.length; Count < DefLength; Count++)  {		OutString=PadChar+OutString;	}	return (OutString);}// -->