title: rounding decimal points
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2808535/round-a-double-to-2-significant-figures-after-decimal-point">Round a double to 2 significant figures after decimal point</a>  </p>
  </blockquote>
  
  
  
  <p>I am trying to work with converting a decimal degree (23.1248) into a minutes style degree(23 7'29.3").
  this is what I have so far:</p>
  
  <pre><code>   double a=23.1248;
     int deg=(int)a;//gives me the degree
     float b=(float) (a-deg);
     int min=(int) (b*60);//gives me the minutes
     double sec= (double) ((c*60)-min);//gives me my seconds
  </code></pre>
  
  <p>everything works fine, but I would like to round the seconds up to either the nearest tenth or hundrenth.  I have looked at decimal formatting, but would prefer not to cast it to a string.  I have also looked at bigdecimal but do not think that would be helpful, </p>