how to reduce a latitude to 4 decimal places
<p>This is my second post on this subject.  I have found dozens of posts on this subject and not a single solution that works.  The location listener will provide you a latitude such as 3.734567E7.  My goal is to reduce the accuracy of that latitude to four decimal places.  I don't care if I truncate it or round it.  the following code...</p>

<pre><code>    Double d = Double.parseDouble("3.734567E7");
    NumberFormat fmtr = new DecimalFormat("###.####");      
    String f = fmtr.format(d);
    Log.w(getClass().getName(), "result using DecimalFormat =     " + f );
    d = (double) Math.round(d * 10000.0) / 10000.0;
    Log.w(getClass().getName(), "result using math round =        " + d );
    f = d.toString();
    Log.w(getClass().getName(), "result string using math round = " + f );
</code></pre>

<p>produces three lines:
37345670
3.734567E7
3.734567E7</p>

<p>none of this processing has any affect on the number.</p>

<p>when I had to do this in C# on my windows phone app I did the following...</p>

<p>myExecution.latitude = Math.Round(newLatitude, 4); It took less than a minute of my time. I have over a weeks time trying to figure out how to do the same thing in java.  the Java math.round, oddley enough, has no way to specify how many decimal places you desire to round to making it totally usless as far as I can understand.</p>

<p>I realize that scientific notation is only supposed to be a way of displaying values and does not have anything to do with how an amount is stored internally.  This makes this problem all the more perplexing.</p>

<p>Can anyone modify the code above to make it round to 4 decimal places?</p>

<p>(but you can't change the 1st line of code.  It must be specified in scientific notation.  If you specify it in decimal notation it works wonderfully.
thanks, Gary</p>
