Java Decimal decimalToChar(int i)

Here you can find the source of decimalToChar(int i)

Description

decimal To Char

License

Open Source License

Declaration

private static char decimalToChar(int i) 

Method Source Code

//package com.java2s;

public class Main {
    private static char decimalToChar(int i) {
        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");
    }/*from  w  ww . j  a  va  2 s  .c om*/
}

Related

  1. decimalPlaces(double value, int precision)
  2. decimalRound(double value, int roundPlaces)
  3. decimalScale(double value, double max)
  4. decimalScaleTime(int value, int max)
  5. decimalScalingBase(double value)