Main Content

mlreportgen.dom.getDefaultNumberFormat

Get default formatting for numeric data generated by DOM API

Since R2021a

Description

example

formatSpec = mlreportgen.dom.getDefaultNumberFormat returns the default number format specification as a character vector. To set the default number format specification, use mlreportgen.dom.setDefaultNumberFormat.

Examples

collapse all

Get the current default number format that the DOM API uses when representing a number as text.

import mlreportgen.dom.*

rpt = Document("myReport","pdf");

numberFormat = getDefaultNumberFormat();
p = Paragraph("Default number format is : ");
p.append(numberFormat);

append(rpt,p);

close(rpt);
rptview(rpt);

Output Arguments

collapse all

Format specification, returned as a character vector. The specification is a valid format specification for the sprintf function and uses one of these operators:

  • %f

  • %e

  • %E

  • %g

  • %G

If the format specification is an empty character vector, a number is formatted using the maximum number of digits needed to represent the number accurately.

Version History

Introduced in R2021a