code: protected XmlSchemaSimpleType createNumericXmlSchemaSimpleType(
              final XsdDataItem xsdDataItem, final String xsdTypeName) {
  
          XmlSchemaSimpleTypeRestriction restriction = createRestriction(xsdTypeName);
  
          /*
           * COBOL native binary are special because even though they have a
           * totalDigits attribute, it is not used enforce a restriction.
           */
          if (xsdDataItem.getCobolType() != CobolTypes.NATIVE_BINARY_ITEM
                  && xsdDataItem.getTotalDigits() > -1) {
  
              /*
               * Due to a bug in JAXB (see JAXB issue 715), unsignedLong may end
               * up being mapped to BigInteger instead of Long when totalDigits is
               * used instead of maxInclusive. So for now, we keep maxInclusive.
               */
              if (xsdDataItem.getXsdType() == XsdType.ULONG) {
                  StringBuilder sb = new StringBuilder();
                  for (int i = 0; i < xsdDataItem.getTotalDigits(); i++) {
                      sb.append("9");
                  }
                  restriction.getFacets().add(
                          createMaxInclusiveFacet(sb.toString()));
              } else {
                  restriction.getFacets().add(
                          createTotalDigitsFacet(xsdDataItem.getTotalDigits()));
              }
          }
  
          /* fractionDigits is a fixed facet for most numerics so be careful */
          if (xsdDataItem.getFractionDigits() > 0) {
              restriction.getFacets().add(
                      createFractionDigitsFacet(xsdDataItem.getFractionDigits()));
          }
  
          /*
           * For xsd:decimal and xsd:integer, we further constrain if the numeric
           * needs to be positive (unsigned).
           */
          if ((xsdDataItem.getXsdType() == XsdType.INTEGER || xsdDataItem
                  .getXsdType() == XsdType.DECIMAL) && !xsdDataItem.isSigned()) {
              restriction.getFacets().add(createMinInclusiveFacet("0"));
          }
          addEnumerationFacets(xsdDataItem, restriction);
          return createXmlSchemaSimpleType(restriction);
      }
docs: Create a simple type for an numeric type.
  <p/>
  Numeric elements might have totaDigits, fractionDigits, minInclusive or
  maxInclusive facets.
  
  @param xsdDataItem COBOL data item decorated with XSD attributes
  @param xsdTypeName the XML schema built-in type name to use as a
  restriction
  @return an XML schema simple type