Here you can find the source of round(double zahl, int stellen)
Parameter | Description |
---|---|
zahl | a parameter |
stellen | a parameter |
public static double round(double zahl, int stellen)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w . j av a 2s. c om * * @param zahl * @param stellen * @return */ public static double round(double zahl, int stellen) { double d = Math.pow(10, stellen); return Math.round(zahl * ((long) d)) / d; } }