mlreportgen.dom.Number Class
Namespace: mlreportgen.dom
Number to include as formatted text in document
Description
Use an object of the mlreportgen.dom.Number class to convert a number to formatted text that you can include in a document.
The conversion uses the first of these format specifications that it finds:
The specification in the
mlreportgen.dom.NumberFormatobject in theStyleproperty of theNumberobjectThe specification in the
NumberFormatobject in theStyleproperty of the element, such as a paragraph, list, or table, that contains theNumberobjectThe default specification set by
mlreportgen.dom.setDefaultNumberFormat
If the conversion does not find a format specification, the conversion uses the maximum number of digits needed to represent the number accurately.
To see what DOM objects you can append an mlreportgen.dom.Number object to, see
Append mlreportgen.dom.Number object to DOM class object.
The mlreportgen.dom.Number class is a handle class.
Class Attributes
ConstructOnLoad | true |
HandleCompatible | true |
For information on class attributes, see Class Attributes.
Creation
Description
numberObj = mlreportgen.dom.Number creates an
empty Number object. Use the Value
property to specify the number to convert to formatted text.
numberObj = mlreportgen.dom.Number(value) creates
a Number object with the specified value.
.
Properties
Methods
Examples
More About
Tips
When you append
mlreportgen.dom.Numberobjects in documents, the object content appends differently depending on the document format. In HTML documents, the content appends in the same line. In PDF and DOCX documents, the content appends in separate lines. To append the content in the same line, create amlreportgen.dom.Paragraphobject, append the content to the paragraph object by using theappendmethod, then append the paragraph object to the document object.
Version History
Introduced in R2021a