code: public static String encodeZeroPadding(float number, int maxNumDigits) {
          String floatString = Float.toString(number);
          int numBeforeDecimal = floatString.indexOf('.');
          numBeforeDecimal = (numBeforeDecimal >= 0 ? numBeforeDecimal : floatString.length());
          int numZeroes = maxNumDigits - numBeforeDecimal;
          StringBuffer strBuffer = new StringBuffer(numZeroes + floatString.length());
          for (int i = 0; i < numZeroes; i++) {
              strBuffer.insert(i, '0');
          }
          strBuffer.append(floatString);
          return strBuffer.toString();
      }
docs: Encodes positive float value into a string by zero-padding number up to the specified number
  of digits
  
  @param number
  positive float value to be encoded
  @param maxNumDigits
  maximum number of digits preceding the decimal point in the largest value in the
  data set
  @return string representation of the zero-padded float value