Here you can find the source of getFloatWithADecimal(float f)
public static float getFloatWithADecimal(float f)
//package com.java2s; //License from project: Apache License public class Main { public static float getFloatWithADecimal(float f) { f = Math.round(f * 10);/*from w w w. j a v a2 s . c o m*/ return f / 10; } }