title: c++ currency converter trailing zeroes
body: <p>i just started programming and wrote a currency converter programme that needs to be accurate to 2 decimals (using double) However i would not like trailing zeroes but users should still be able to input decimals with set precision rounding it off to a whole integer</p>
  
  <p>Here is the code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  
  using namespace std;
  
  const double DOLLAR = 0.05917;
  const double EUROS = 0.05681;
  
  int main()
  {
  double rand;
  double equivD;
  double equivE;
  
  cout &lt;&lt; setprecision(2)&lt;&lt;fixed;
  
  cout &lt;&lt; " Enter Rand amount: ";
  cin &gt;&gt; rand;
  
  cout &lt;&lt; rand &lt;&lt; " Rand(s)= ";
  equivD= (rand*DOLLAR);
  cout &lt;&lt; equivD&lt;&lt; " Dollar(s)\n ";
  
  cout &lt;&lt; rand &lt;&lt; " Rand(s)= ";
  equivE= (rand*EUROS);
  cout &lt;&lt; equivE&lt;&lt; " Euro(s)\n ";
  
  return 0;
  
  }
  </code></pre>
  
  <p>Output if entered value is a 1000 is:</p>
  
  <pre><code>1000.00= 57.24 Dollars 
  1000.00= answer
  </code></pre>
  
  <p>If an integer is inputed without decimals I would like to remove the <code>.00</code> but still keep it as a <code>double</code> in case a decimal is inputed. How do I do this?</p>