//-------------------------------------------------------------------------
  //From my JAVA How-to site (general - > part 1 - > Round a double), this
  //snippet :

  // JDK1.0.2
  public class divers {
    public static void main(String args[]){
      divers d = new divers();
      d.testRound();
    }
    
    public void testRound(){
      double r = round(3.1537, 2);
      System.out.println(r); // output is 3.15
      System.out.println("$" + r); // output is $3.15
    }
    
    double round(double value, int decimalPlace) {
      double power_of_ten = 1;
      while (decimalPlace-- > 0)
	power_of_ten *= 10.0;
      return Math.round(value * power_of_ten)
	/ power_of_ten;
    }
  }
  
  //    Real Gagnon     mailto:gagnonr@gespro.com
  //        JAVA & Javascript How-to
  //http://www.geocities.com/SiliconValley/Vista/1337



