Java Decimal decimalScale(double value, double max)

Here you can find the source of decimalScale(double value, double max)

Description

decimal Scale

License

Apache License

Declaration

public static double decimalScale(double value, double max) 

Method Source Code

//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;
    }
}

Related

  1. decimalPart(float number)
  2. decimalPlace(float theValue, int theDecimalPlaces)
  3. decimalPlaces(double value, int precision)
  4. decimalPlaces(double value, int precision)
  5. decimalRound(double value, int roundPlaces)
  6. decimalScaleTime(int value, int max)
  7. decimalScalingBase(double value)
  8. decimalToChar(int i)