title: Number formatting in Scala?
body: <p>I have a dynamically changing input reading from a file. The numbers are either <code>Int</code> or <code>Double</code>. Why does Scala print <code>.0</code> after every <code>Double</code> number? Is there a way for Scala to print it the same way it reads it?</p>
  
  <p>Example:</p>
  
  <pre><code>var x:Double = 1
  println (x)             // This prints '1.0', I want it to print '1'
  x = 1.0                 // This prints '1.0', which is good
  </code></pre>
  
  <p>I can't use <code>Int</code> because some of the input I get are <code>Double</code>s. I can't use <code>String</code> or <code>AnyVal</code> because I perform some math operations.</p>
  
  <p>Thank you,</p>