Java Number Round Rounding(double d, int i)

Here you can find the source of Rounding(double d, int i)

Description

Rounding

License

Apache License

Declaration

public static String Rounding(double d, int i) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static String Rounding(double d, int i) {
        long a = (long) d;
        long b = (long) ((d - a) * Math.pow(10, i));
        return a + "." + b;
    }//from  w w w . ja  va 2  s  .com
}

Related

  1. roundFormat(final int numPrec, final double number)
  2. RoundFullUp(double d)
  3. roundHalfAway(double d)
  4. RoundHalfUp(double d)
  5. roundIfClose(double val)
  6. rounding(double val)
  7. roundingRightShift(int x, int count)
  8. roundIntegerToNearestUpperTenth(int a)
  9. roundInventorySize(final int size)