Here you can find the source of toDecimal(float value)
public static float toDecimal(float value)
//package com.java2s; //License from project: Open Source License public class Main { public static float toDecimal(float value) { if (value < 100) return value / 100; while (value > 1) { value /= 10;//from w w w. j av a 2s . c om } return value; } }