title: Formatting a double in JSF
body: <p>I have a problem similar to the one found here : <a href="https://stackoverflow.com/questions/86531/jsf-selectitem-label-formatting">JSF selectItem label formatting</a>. </p>
  
  <p>What I want to do is to accept a double as a value for my  and display it with two decimals. Can this be done in an easy way? </p>
  
  <p>I've tried using  but that seems to be applied on the value from the inputText that is sent to the server and not on the initial value in the input field.</p>
  
  <p>My code so far:</p>
  
  <pre><code>&lt;h:inputText id="december" value="#{budgetMB.december}" onchange="setDirty()" styleClass="StandardBlack"&gt;
      &lt;f:convertNumber maxFractionDigits="2" groupingUsed="false" /&gt;
  &lt;/h:inputText&gt;
  </code></pre>
  
  <p>EDIT: The above code actually works. I was fooled by JDeveloper that didn't update the jsp page even when I did a explicit rebuild of my project and restarted the embedded OC4J server. However, after a reboot of my computer everything was fine. </p>