Here you can find the source of decimalScale(double value, double max)
public static double decimalScale(double value, double max)
//package com.java2s; //License from project: Apache License public class Main { public static double decimalScale(double value, double max) { return value / decimalScalingBase(value); }// ww w.ja va 2 s .c o m public static double decimalScale(long value, int max) { return value / decimalScalingBase(max); } public static double decimalScalingBase(double value) { long b = 1; while (b <= value) { b *= 10; } return b; } }