title: Format decimal c# - Keep last zero
body: <p>I have been searching for this but cannot seem to find the answer. I have the following decimals with the corresponding output that I want from String.Format</p>
  
  <p>100.00 -> 100<br>
  100.50 -> 100.50<br>
  100.51 -> 100.51  </p>
  
  <p>My problem is that I cannot seem to find a format which will keep the 0 on the end of 100.50 as well as remove the 2 zeros from 100.</p>
  
  <p>Any help is much appreciated.</p>
  
  <p><strong>EDIT</strong>
  For some more clarity. I have variables of type decimal, they are only ever going to be 2 decimal places. Basically I want to display 2 decimal places if they exist or none, I don't want to display one decimal place in the case of 100.50 becoming 100.5</p>