title: How to format Numbers in Velocity Templates?
body: <p>I am getting a java object in my velocity template. The object has a double value which I want to format to 2 decimal places and display it in my template.</p>
  
  <p>The class for which im getting an object is something like this</p>
  
  <pre><code>Class Price
  {
  double value;
  String currency;
  }
  </code></pre>
  
  <p>In my velocity template, im getting the value like this</p>
  
  <pre><code>$price.value
  </code></pre>
  
  <p>but I need to format it to 2 decimal places before displaying it.</p>
  
  <p>I want to convert </p>
  
  <p>23.59004  to 23.59</p>
  
  <p>35.7  to 35.70</p>
  
  <p>3.0 to 3.00</p>
  
  <p>9 to 9.00</p>
  
  <p>Please tell me how can I do it in velocity template? I searched a lot for this and found that I can use velocity tools, but there are no examples related to it? and can i use velocity tools in templates?</p>