Here you can find the source of round(float Rval, int Rpl)
public static float round(float Rval, int Rpl)
//package com.java2s; public class Main { public static float round(float Rval, int Rpl) { float p = (float) Math.pow(10, Rpl); Rval = Rval * p;/*from w w w . j a v a 2 s . co m*/ float tmp = Math.round(Rval); return (float) tmp / p; } }