   function FormatNumber(num, decimalNum, bolLeadingZero, bolParens)
   /* IN - num:            the number to be formatted
           decimalNum:     the number of decimals after the digit
           bolLeadingZero: true / false to use leading zero
           bolParens:      true / false to use parenthesis for - num

      RETVAL - formatted number
   */
   {
       var tmpNum = num;

       // Return the right number of decimal places
       tmpNum *= Math.pow(10,decimalNum);
//       tmpNum = Math.floor(tmpNum);
       tmpNum = Math.round(tmpNum);
       tmpNum /= Math.pow(10,decimalNum);

       var tmpStr = new String(tmpNum);
       f = tmpStr.search(/\./);
       if(f == -1) {
            if(decimalNum != 0) tmpStr += ".";
            for(X = 0; X < decimalNum; X++ ) {
                tmpStr+= "0";
            }
       }
       else {
           NumbersAfterDecimalPoint = tmpStr.length - f -1;
           for(x=NumbersAfterDecimalPoint;x<decimalNum; x++) {
        tmpStr += "0";
       }

       }

       // See if we need to hack off a leading zero or not
       if (!bolLeadingZero && num < 1 && num > -1 && num !=0)
           if (num > 0)
               tmpStr = tmpStr.substring(1,tmpStr.length);
           else
               // Take out the minus sign out (start at 2)
               tmpStr = "-" + tmpStr.substring(2,tmpStr.length);


       // See if we need to put parenthesis around the number
       if (bolParens && num < 0)
           tmpStr = "(" + tmpStr.substring(1,tmpStr.length) + ")";


       return tmpStr;
   }

   function PrintableEnglishMetricUnits(theNum, Metric, decimalsToOutPut, AreaOrLength) {
        var eng, met, conversion;
        if(AreaOrLength == "Length") {
            if(Metric == "English") {
                conversion = 1 / 3.28083333333333;
            }
            else {
                conversion =  3.28083333333333;
            }
        }
        else {
            if(Metric == "English") {
                conversion = 1 / 10.76391042;
            }
            else {
                conversion = 10.76391042;
            }
        }
        if(Metric == "English") {
            eng = theNum;
            met = theNum * conversion;
        }
        else {
            eng = theNum * conversion;
            met = theNum;
        }
        eng = FormatNumber(eng, decimalsToOutPut, true, false);
        met = FormatNumber(met, decimalsToOutPut, true, false);
        return (eng + "(" + met + "),ft(m)");
   }
