Java Number Round roundIntegerToNearestUpperTenth(int a)

Here you can find the source of roundIntegerToNearestUpperTenth(int a)

Description

round Integer To Nearest Upper Tenth

License

Open Source License

Declaration

public static int roundIntegerToNearestUpperTenth(int a) 

Method Source Code

//package com.java2s;
/**//from  ww  w  . ja v  a2 s . co m
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation
 * (http://www.gnu.org/licenses/gpl.txt ). This program is
 * distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
 * License for more details.
 *
 * @author <a href="mailto:zudairee@mail.nih.gov">
 * Enrique Zudaire</a>, Radiation Oncology Branch, NCI, NIH
 * May, 2011
 * angiotool.nci.nih.gov
 *
 */

public class Main {
    public static int roundIntegerToNearestUpperTenth(int a) {
        int remainder = a % 10;
        while (remainder != 0) {
            a += 1;
            remainder = a % 10;
        }
        return a;
    }
}

Related

  1. RoundHalfUp(double d)
  2. roundIfClose(double val)
  3. Rounding(double d, int i)
  4. rounding(double val)
  5. roundingRightShift(int x, int count)
  6. roundInventorySize(final int size)
  7. roundJs(double v, int n)
  8. roundLong(double a)
  9. roundM(int n, int m)