Java Utililty Methods Decimal

List of utility methods to do Decimal

Description

The list of methods to do Decimal are organized into topic(s).

Method

doubledecimalScale(double value, double max)
decimal Scale
return value / decimalScalingBase(value);
doubledecimalScaleTime(int value, int max)
decimal Scale Time
return (((double) value) / max);
doubledecimalScalingBase(double value)
decimal Scaling Base
long b = 1;
while (b <= value) {
    b *= 10;
return b;
chardecimalToChar(int i)
decimal To Char
if (i >= 0 && i < 10)
    return (char) ('0' + i);
else if (i >= 10 && i < 35)
    return (char) ('a' + i - 10);
throw new IllegalArgumentException("cannot convert " + i + " to character");