function format(price) {
  var lth, compos;
  lth = price.length;
  pos = price.indexOf(".");
  if (pos==-1)     price = price + ".00";
  if (lth-pos==2)  price = price + "0";
  if ((price.indexOf("e"))==-1) {
     lth = price.length;
     pos = lth-3;
  }
  if (pos-3 > 0) {
    while (pos-3 > 0) {
      price = price.substring(0,pos-3) + "," + price.substring(pos-3,lth);
      pos -=3;
      lth = price.length;
    }
  }
  price = "$" + price;
  return price;
}

function calculate(tag) {
   var status = Checking(tag);
   if (!status)   ResetButton();
   else   compute();
}