Here you can find the source of toFloat(long intPart, long decimalPart, long decimalPlaces)
public static Float toFloat(long intPart, long decimalPart, long decimalPlaces)
//package com.java2s; //License from project: LGPL public class Main { public static Float toFloat(long intPart, long decimalPart, long decimalPlaces) { if (intPart < 0 || decimalPart < 0 || decimalPlaces < 0) return null; if (decimalPart == 0 || decimalPlaces == 0) { return Float.valueOf(intPart); }// w w w . j a va 2 s . co m float divisor = (float) Math.pow(10, decimalPlaces); return Float.valueOf(((float) intPart) + (((float) decimalPart) / divisor)); } }