Here you can find the source of round(double value, double factor)
Parameter | Description |
---|---|
value | The value to round. |
factor | The factor of where to round. |
public static double round(double value, double factor)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w ww . j av a2 s . co m*/ * Round the value to the nearest factor. * * @param value The value to round. * @param factor The factor of where to round. * @return The rounded value. */ public static double round(double value, double factor) { return (Math.round(value / factor) * factor); } }