title: How can I format this string that represents decimal number in my JSP page?
body: <p>I have the following problem. I am working on a JSP page that use JQuery.</p>
  
  <p>In this page I show some money amounts into a table, something like this:</p>
  
  <pre><code>&lt;td width = "8.33%"&gt;
      &lt;%=salDettaglio.getTotImponibile().toString() != null ? salDettaglio.getTotImponibile().toString() : "" %&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>The obtained object (from the getTotImponibile() method) is a BigDecimal </p>
  
  <p>In the td of my table it is shown a value as: <strong>447.93</strong>.</p>
  
  <p>Now I have to format this amount in the following way:</p>
  
  <ol>
  <li><p>Use the <strong>,</strong> character instead the <strong>.</strong> (for the decimal digits).</p></li>
  <li><p>Show always 2 decimal digits after the <strong>.</strong> For example I can have only one decimal digit as 10,4 and I have to show 10,40 or I can have more than 2 decimal digits and in this case I have to show only the firs 2 decimal digits (for example 10,432 so I have to show 10,43)</p></li>
  </ol>
  
  <p>So what can I do to achieve these 2 tasks? Actually I am showing a string that represent a decimal number. Have I to cast this value into a double or something like this?</p>