Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

INumberFormat

INumberFormat

The spec.INumberFormat interface contains all of the information required to format a number value.

This interface is used to form a pentaho.data.spec.IFormatProvider specification.

A number format describes how to format numbers by using a formatting mask. The mask syntax is mostly compatible with VB's format() function mask syntax. See http://apostate.com/programming/vb-format-syntax.html for more information on the mask syntax (only the number related subset is relevant).

Properties:
Name Default Value Description
mask : string

The formatting mask.

When the mask is "", numbers are formatted like JavaScript's toString() would.

The default value is "".

style : pentaho.data.spec.INumberFormatStyle

The number format style.

The default number format style has all of its properties with their default values.

Source: doc-js/pentaho/data/spec/INumberFormat.jsdoc, line 17

See also: pentaho.data.spec.IFormatProvider , pentaho.data.AtomicTypeName.NUMBER

Example

A sample number format specification

 var numberFormatSpec = {
 mask: "#,0.00 A??",
 style: {
 integerPad: "0",
 fractionPad: "0",
 decimal: ",",
 group: " ",
 groupSizes: [3],
 abbreviations: ["K", "M", "B", "T"],
 negativeSign: "-",
 currency: "???"
 }
 };