code: public static String encodeRealNumberRange(int number, int maxNumDigits, int offsetValue) {
          long offsetNumber = number + offsetValue;
          String longString = Long.toString(offsetNumber);
          int numZeroes = maxNumDigits - longString.length();
          StringBuffer strBuffer = new StringBuffer(numZeroes + longString.length());
          for (int i = 0; i < numZeroes; i++) {
              strBuffer.insert(i, '0');
          }
          strBuffer.append(longString);
          return strBuffer.toString();
      }
docs: Encodes real integer value into a string by offsetting and zero-padding number up to the
  specified number of digits. Use this encoding method if the data range set includes both
  positive and negative values.
  
  @param number
  integer to be encoded
  @param maxNumDigits
  maximum number of digits in the largest absolute value in the data set
  @param offsetValue
  offset value, has to be greater than absolute value of any negative number in the
  data set.
  @return string representation of the integer