code: public static <N extends Number> int getRHD(N number) {
                  String numberAsString = String.valueOf(number);
                  return numberAsString.substring(numberAsString.lastIndexOf('.') + 1).length();
          }
docs: Returns the number of places after the decimal separator of the given
  number.
  
  @param <N> Number type
  @param number Basic number for operation
  @return The number of places after the decimal separator of
  <code>number</code>