title: How do I override a JS function in js/varien/product.js?
body: <p>I am making a Magento extension that calls a custom JS file on the product view page. This custom JS file will load last and needs to override the formatPrice() function found at the bottom of /js/varien/product.js.</p>
  
  <p>The original formatPrice function is as follows:</p>
  
  <pre><code>formatPrice: function(price) {
  return formatCurrency(price, this.priceFormat);
  }
  </code></pre>
  
  <p>I would like to replace / override this function with the following:</p>
  
  <pre><code>formatPrice: function(price) {
  if (price % 1 == 0) { this.priceFormat.requiredPrecision = 0; }
  
  return formatCurrency(price, this.priceFormat);
  }
  </code></pre>
  
  <p>How do I write the JS code in my custom JS file so that it will properly override this function? I'm not familiar with JS enough to know.</p>