trying to calculate BMI but get a 0.0 answer after using Math.round()
<p>So I'm trying to calculate my bmi using the following method. </p>

<pre><code>double bmi = weight / ((height * 100) * (height * 100));
bmi = Math.round(bmi * 100.0) / 100.0;
</code></pre>

<p>From the first line I get an answer that looks like this:</p>

<p>2.3457310760477412E-7</p>

<p>which is why I want to round this to one or two decimals. But this results in bmi being 0.0 instead. </p>

<p>I have also tried decimalformat which also returns 0. What am I doing wrong?</p>

<p>EDIT - SOLUTION</p>

<p>The problem was my formula! Centimeter should be divided by 10 not multiplied!
Thanks!</p>

<p>//André</p>
