title: Double: using the actual number of decimal places
body: <p>I'm creating a calculator program, but I don't know how to set the precision of the decimal places of the calculated answer so that the actual number of decimal places is displayed.
  Examples:
  -If the answer is 6, it would display 6, not 6.0000000</p>
  
  <p>-if the answer is 8.23, it would display 8.23, not 8.23000000</p>
  
  <p>etc.</p>
  
  <p>How would I set the precision as such?</p>