Here you can find the source of round(float f, int i)
Parameter | Description |
---|---|
f | a parameter |
i | a parameter |
public static float round(float f, int i)
//package com.java2s; public class Main { /**//w ww . j a v a 2s . co m * Round a number to "i" digits after the comma * @param f * @param i */ public static float round(float f, int i) { int x = (int) (f * i); float f2 = (float) x / (float) i; return f2; } }