title: What is wrong with this snap svg plugin?
body: <p>I have this code :</p>
  
  <pre><code> el.replace(/[0-9]*\.[0-9]*/g, function(x){ return (+x).toFixed(2)  }) };
  </code></pre>
  
  <p>It works great on an individual svg path to trim its decimal places. Now I want to be able to trim all the paths from a paper(svg).To do that I am trying to make a snap svg plugin here:</p>
  
  <pre><code>Snap.plugin(function(Snap, Element, Paper, glob){
  
       Paper.prototype.trimPthDec = function(){
  
      this.paper.selectAll('path').forEach( function(el) { el.trim() } ) ;
  
        function  trim(){
  
       el.replace(/[0-9]*\.[0-9]*/g, function(x){ return (+x).toFixed(2)  }) };
  
          //return paper;
  
  });
  </code></pre>
  
  <p>But it doesn't seem to work when I call it like: </p>
  
  <pre><code>// And use it like this to update the paper with new paths?!:
  trimPthDec(); // I get this error: Uncaught ReferenceError: trimPthDec is not defined
  </code></pre>
  
  <p>Could anybody tell me why it is not working please?</p>