function floatToTwoDec(number)
{
   var wholeNum="";
   var decimal="";
   var i=0;
    <!-- takes care of rounding issues --->
   number = parseFloat(number)+0.005;
    <!-- converts back to a string by adding empty string --->
   number=number+"";
   
   nextchar=number.charAt(i++);
   
   while(nextchar!="." && nextchar !="")
   {
      wholeNum=wholeNum + nextchar;
      nextchar=number.charAt(i);      
      i++;
   }

    <!-- for loop to get the next two decimal places-->   
   for(var j=0; j < 2; j++)
   {   nextchar=number.charAt(i);
       if(nextchar=="")
          nextchar="0";
       
       decimal=decimal+nextchar;
       i++;
   }

   result=wholeNum+"."+decimal;
   return result;
}