Here you can find the source of round(final double v)
Parameter | Description |
---|---|
v | number |
public static double round(final double v)
//package com.java2s; /******************************************************************************* * Copyright (c) 2011 Ubiquitous Knowledge Processing Lab * /*ww w. j a va 2 s .c o m*/ * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v3 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl.html * * Project Website: * http://jwpl.googlecode.com * * Contributors: * Torsten Zesch * Simon Kulessa * Oliver Ferschke ******************************************************************************/ public class Main { /** * Rounds the given number to a precision of two after digit numbers. * * @param v * number * @return rounded number */ public static double round(final double v) { return ((long) (v * 100.)) / 100.; } }