Here you can find the source of roundIntegerToNearestUpperTenth(int a)
public static int roundIntegerToNearestUpperTenth(int a)
//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; } }