title: How to call javascript function from tag lib's?
body: <p>Well, I have a question regarding javascript, how to call a js function from jsp or jspx files.</p>
  
  <p>on my jspx page I have a loop which adds data to a table, here is the code sample</p>
  
  <pre><code>&lt;c:forEach items="${loadList}" var="load"&gt;
     &lt;tr&gt;
       &lt;td&gt;
         &lt;nobr&gt;&lt;c:out value="${load}"/&gt;&lt;/nobr&gt;
       &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>Here the line no 3 does a c:out on the load var which prints as </p>
  
  <pre><code>55.959090909090904
  118.94545454545454
  133.46818181818182
  19.727272727272727
  </code></pre>
  
  <p>etc values.
  So I have written a js function to round of this values to as </p>
  
  <pre><code>55.95
  118.94
  133.46
  19.72
  </code></pre>
  
  <p>JS function </p>
  
  <pre><code>function roundOfValue(value, limit) {
      value = value.toFixed(limit);
      return value;
  }
  </code></pre>
  
  <p>I am trying to call this function in the c:out as </p>
  
  <pre><code>&lt;nobr&gt;&lt;c:out value="roundOfValue(${system},2);"/&gt;&lt;/nobr&gt;
  </code></pre>
  
  <p>but this does not call the function and prints the same on the UI. Is there a way to call this function which will prints the rounded off values. </p>
  
  <p>I even tried the following but it does not work</p>
  
  <pre><code>1. &lt;c:forEach items="${systemList}" var="system" varStatus="row"&gt;
  2.  &lt;tr&gt;&lt;td id="load"&gt;
  3.   &lt;nobr&gt;&lt;div id="div"&gt;&lt;/div&gt;
  4.    &lt;script&gt;
  5.     document.getElementById(div).innerHTML =  roundOfValue(${system},2);
   6.   &lt;/script&gt;&lt;/nobr&gt;
  4.  &lt;/td&gt;&lt;/tr&gt;
  5. &lt;/c:forEach&gt;
  </code></pre>
  
  <p>Please suggest some steps to do this. 
  Thanks </p>