Java why doesn't my calculation work on this code?
<p>Hi I'm trying to run a calculation but I can't seem to put it all on one line, I have to split the result into two seperate lines to achieve the desired result (which seems a bit long winded). 
Can anyone explain where I'm going wrong? </p>

<p>both x and y are doubles.</p>

<p>Example 1: (incorrect)</p>

<pre><code>y=0.68
x= (Math.round(y* 10))/10;
result x=0
</code></pre>

<p>Example 2: (correct)</p>

<pre><code>y=0.68
x= Math.round(y* 10);
x = x/10;
result x=0.7
</code></pre>

<p>thanks for your time.</p>
