Create an XML schema fractionDigits facet.

@param fractionDigits the value to set
@return an XML schema fractionDigits facet
187814
protected XmlSchemaFractionDigitsFacet createFractionDigitsFacet(
            final int fractionDigits) {
        XmlSchemaFractionDigitsFacet xmlSchemaFractionDigitsFacet = new XmlSchemaFractionDigitsFacet();
        xmlSchemaFractionDigitsFacet.setValue(fractionDigits);
        return xmlSchemaFractionDigitsFacet;
    }
522395
public void appendXmlSchema(Element root) {

        Element element = root.addElement(CmsXmlContentDefinition.XSD_NODE_ELEMENT);
        element.addAttribute(CmsXmlContentDefinition.XSD_ATTRIBUTE_NAME, getName());
        element.addAttribute(CmsXmlContentDefinition.XSD_ATTRIBUTE_TYPE, getTypeName());
        if ((getMinOccurs() > 1) || (getMinOccurs() == 0)) {
            element.addAttribute(CmsXmlContentDefinition.XSD_ATTRIBUTE_MIN_OCCURS, String.valueOf(getMinOccurs()));
        }
        if (getMaxOccurs() > 1) {
            if (getMaxOccurs() == Integer.MAX_VALUE) {
                element.addAttribute(
                    CmsXmlContentDefinition.XSD_ATTRIBUTE_MAX_OCCURS,
                    CmsXmlContentDefinition.XSD_ATTRIBUTE_VALUE_UNBOUNDED);
            } else {
                element.addAttribute(CmsXmlContentDefinition.XSD_ATTRIBUTE_MAX_OCCURS, String.valueOf(getMaxOccurs()));
            }
        }
    }
372200
@XmlElementDecl(namespace = "http://schema.intuit.com/finance/v3", name = "NumberTypeCustomFieldDefinition", substitutionHeadNamespace = "http://schema.intuit.com/finance/v3", substitutionHeadName = "IntuitObject")
    public JAXBElement<NumberTypeCustomFieldDefinition> createNumberTypeCustomFieldDefinition(NumberTypeCustomFieldDefinition value) {
        return new JAXBElement<NumberTypeCustomFieldDefinition>(_NumberTypeCustomFieldDefinition_QNAME, NumberTypeCustomFieldDefinition.class, null, value);
    }
279366
public void setDecimals(final int DECIMALS) {
        if (null == decimals) {
            _decimals    = clamp(0, 5, DECIMALS);
            formatString = new StringBuilder("%.").append(_decimals).append("f").toString();
            redraw();
        } else {
            decimals.set(DECIMALS);
        }
    }
615637
public static FractionNumber createMaxDenominator(final double value, int maxDenom, boolean wholeType) {
        final FractionNumber fractionNumber = new FractionNumber(value);
        fractionNumber.wholeType = wholeType;
        
        final SimpleFraction fraction = SimpleFraction.createFractionMaxDenominator(Math.abs(value), maxDenom);
        setupFractionPart(fraction, fractionNumber);
        
        return fractionNumber;
    }
715
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "abs")
    public JAXBElement<ArithType> createAbs(ArithType value) {
        return new JAXBElement<ArithType>(_Abs_QNAME, ArithType.class, null, value);
    }
1196707
public PactDslJsonArray decimalType() {
    generators.addGenerator(Category.BODY, rootPath + appendArrayIndex(1), new RandomDecimalGenerator(10));
    return decimalType(new BigDecimal("100"));
  }
1241721
protected XmlSchemaSimpleTypeRestriction createRestriction(
            final String xsdTypeName) {
        XmlSchemaSimpleTypeRestriction restriction = new XmlSchemaSimpleTypeRestriction();
        restriction.setBaseTypeName(new QName(
                XMLConstants.W3C_XML_SCHEMA_NS_URI, xsdTypeName));
        return restriction;
    }
1063838
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "partialdiff")
    public JAXBElement<PartialdiffType> createPartialdiff(PartialdiffType value) {
        return new JAXBElement<PartialdiffType>(_Partialdiff_QNAME, PartialdiffType.class, null, value);
    }
491896
public int getDefaultFractionDigits(CurrencyUsage Usage) {
        CurrencyMetaInfo info = CurrencyMetaInfo.getInstance();
        CurrencyDigits digits = info.currencyDigits(subType, Usage);
        return digits.fractionDigits;
    }
415688
protected XmlSchemaPatternFacet createPatternFacet(final String pattern) {
        XmlSchemaPatternFacet xmlSchemaPatternFacet = new XmlSchemaPatternFacet();
        xmlSchemaPatternFacet.setValue(pattern);
        return xmlSchemaPatternFacet;
    }
564542
private static Bitmap fractionalDecode(FractionalDecodeShim shim,
            Options options, int requestedWidth, int requestedHeight) {
        final int rawWidth = options.outWidth;
        final int rawHeight = options.outHeight;
        final float sampledWidth = (float) rawWidth / options.inSampleSize;
        final float sampledHeight = (float) rawHeight / options.inSampleSize;

        // Use the simple path, if we can/must
        if (requestedWidth == 0
                || requestedHeight == 0 //
                || sampledWidth <= Math.abs(requestedWidth)
                || sampledHeight <= Math.abs(requestedHeight)) {
            if (VERBOSE_DECODE) {
                Log.d(TAG,
                        "Can't use slice decoder: sampledWidth = %.0f, requestedWidth = %d; sampledHeight = %.0f, requestedHeight = %d",
                        sampledWidth, requestedWidth, sampledHeight,
                        requestedHeight);
            }
            return shim.decode(options);
        }

        // We must use a BitmapRegionDecoder to read and resize 'slices' of the
        // input
        BitmapRegionDecoder decoder = shim.newRegionDecoder();
        try {

            float scale = Math.max(scale(requestedWidth, sampledWidth),
                    scale(requestedHeight, sampledHeight));

            int scaledSliceWidth = roundUp(sampledWidth * scale);
            int slices = (decoder == null) ? 1 : roundUp(sampledHeight
                    / (SLICE_SIZE / sampledWidth));
            int sliceRows = (int) (rawHeight / slices);
            float scaledSliceRows = sliceRows / options.inSampleSize * scale;

            Bitmap result = Bitmap.createBitmap((int) (sampledWidth * scale),
                    (int) (sampledHeight * scale), Config.ARGB_8888);
            Canvas canvas = new Canvas(result);
            Paint paint = new Paint(Paint.FILTER_BITMAP_FLAG);

            // Rect decode, uses 'raw' coordinates
            Rect decode = new Rect(0, 0, rawWidth, sliceRows);
            // RectF target, uses scaled coordinates
            RectF target = new RectF(0, 0, scaledSliceWidth, scaledSliceRows);
            Bitmap slice = options.inBitmap = null;
            boolean hasAlpha = false;
            for (int index = 0; index < slices; ++index) {
                slice = options.inBitmap = //
                (decoder == null) ? shim.decode(options) : //
                        decoder.decodeRegion(decode, options);

                hasAlpha |= slice.hasAlpha();

                canvas.drawBitmap(slice, null, target, paint);

                decode.offset(0, sliceRows);
                target.offset(0, scaledSliceRows);
            }
            slice.recycle();

            // log(TAG,
            // "fractionalDecode: result.hasAlpha() == %b, slices' hasAlpha == %b",
            // result.hasAlpha(), hasAlpha);
            result.setHasAlpha(hasAlpha);
            return result;

        } finally {
            if (decoder != null) {
                decoder.recycle();
            }
        }
    }
764742
public void xmlDeclaration(Map<String, Object> args) {
        Map<String, Map<String, Object>> map = new HashMap<String, Map<String, Object>>();
        map.put("xml", args);
        pi(map);
    }
1302772
function fractionDigits(number) {
  var splitArr = number.toString().split('.');
  return (splitArr.length > 1) ?
    splitArr[1].length :
    0;
}
898482
public static String validateXMLAgainstSchema(final String xml) {
		// Validate XML against schema
		if (xml != null && !xml.equals("")) {
			// Wrap XML with a root element (if required)
			String testXML = wrapXMLInRootElement(xml);
			try {
				// Create SAX Parser Factory
				SAXParserFactory spf = SAXParserFactory.newInstance();
				spf.setNamespaceAware(true);
				spf.setValidating(true);

				// Create SAX Parser
				SAXParser parser = spf.newSAXParser();
				parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaLanguage",
						XMLConstants.W3C_XML_SCHEMA_NS_URI);

				// Set schema location
				Object schema = DebugValidateXML.class.getResource(getSchemaPath()).toString();
				parser.setProperty("http://java.sun.com/xml/jaxp/properties/schemaSource", schema);

				// Setup the handler to throw an exception when an error occurs
				DefaultHandler handler = new DefaultHandler() {
					@Override
					public void warning(final SAXParseException e) throws SAXException {
						LOG.warn("XML Schema warning: " + e.getMessage(), e);
						super.warning(e);
					}

					@Override
					public void fatalError(final SAXParseException e) throws SAXException {
						throw e;
					}

					@Override
					public void error(final SAXParseException e) throws SAXException {
						throw e;
					}
				};

				// Validate the XML
				InputSource xmlSource = new InputSource(new StringReader(testXML));
				parser.parse(xmlSource, handler);

			} catch (SAXParseException e) {
				return "At line " + e.getLineNumber() + ", column: " + e.getColumnNumber()
						+ " ==> " + e.getMessage();
			} catch (Exception e) {
				return e.getMessage();
			}
		}

		return null;
	}
976314
@XmlElementDecl(namespace = "http://www.w3.org/1998/Math/MathML", name = "sum")
    public JAXBElement<ArithType> createSum(ArithType value) {
        return new JAXBElement<ArithType>(_Sum_QNAME, ArithType.class, null, value);
    }
1312661
public Schema createSchema(SAXSource source, PropertyMap properties)
            throws IOException, SAXException, IncorrectSchemaException {
    ErrorHandler eh = properties.get(ValidateProperty.ERROR_HANDLER);
    CountingErrorHandler ceh = new CountingErrorHandler(eh);
    InputSource in = source.getInputSource();
    String systemId = in.getSystemId();
    IfValidHandler ifValidHandler = new IfValidHandler();
    ifValidHandler.setErrorHandler(ceh);
    try {
      SAXTransformerFactory factory = (SAXTransformerFactory)transformerFactoryClass.newInstance();
      initTransformerFactory(factory);
      TransformerHandler transformerHandler = factory.newTransformerHandler(schematron);
      ifValidHandler.setDelegate(transformerHandler);
      Transformer transformer = transformerHandler.getTransformer();
      String phase = properties.get(SchematronProperty.PHASE);
      if (phase != null)
        transformer.setParameter("phase", phase);
      boolean diagnose = properties.contains(SchematronProperty.DIAGNOSE);
      if (diagnose)
        transformer.setParameter("diagnose", Boolean.TRUE);
      PropertyMapBuilder builder = new PropertyMapBuilder(properties);
      builder.put(ValidateProperty.ERROR_HANDLER, ifValidHandler);
      Validator validator = schematronSchema.createValidator(builder.toPropertyMap());
      ifValidHandler.setValidator(validator.getContentHandler());
      XMLReader xr = source.getXMLReader();
      if (xr == null)
        xr = ResolverFactory.createResolver(properties).createXMLReader();
      xr.setContentHandler(ifValidHandler);      
      xr.setDTDHandler(validator.getDTDHandler());  // not strictly necessary
      factory.setErrorListener(new SAXErrorListener(ceh, systemId));
      TemplatesHandler templatesHandler = factory.newTemplatesHandler();
      templatesHandler.setSystemId(systemId);
      LocationFilter stage2 = new LocationFilter(new ErrorFilter(templatesHandler, ceh, localizer), systemId);
      transformerHandler.setResult(new SAXResult(stage2));
      xr.setErrorHandler(ceh);
      xr.parse(in);
      SAXException exception = stage2.getException();
      if (exception != null)
        throw exception;
      if (ceh.getHadErrorOrFatalError())
        throw new IncorrectSchemaException();
      // Getting the templates can cause errors to be generated.
      Templates templates = templatesHandler.getTemplates();
      if (ceh.getHadErrorOrFatalError())
        throw new IncorrectSchemaException();
      return new SchemaImpl(templates,
                            transformerFactoryClass,
                            properties,
                            supportedPropertyIds);
    }
    catch (SAXException e) {
      throw cleanupSAXException(e);
    }
    catch (TransformerConfigurationException e) {
      throw new SAXException(localizer.message("unexpected_schema_creation_error"));
    }
    catch (InstantiationException e) {
      throw new SAXException(e);
    }
    catch (IllegalAccessException e) {
      throw new SAXException(e);
    }
  }