Here you can find the source of roundNumber(float input, float rounding)
public static float roundNumber(float input, float rounding)
//package com.java2s; //License from project: Open Source License public class Main { public static float roundNumber(float input, float rounding) { int o = (int) (input * rounding); return o / rounding; }/*w w w .j a va2 s . co m*/ }