Skip to main content
Pentaho Documentation

INumberFormatStyle

INumberFormatStyle

The spec.INumberFormatStyle interface contains information that affects the style of number formatting.

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

Properties:
Name Default Value Description
decimal : string

The character to use in place of the "." mask character.

The decimal point separates the integer and fraction parts of the number.

The default value is ".".

group : string

The character to use in place of the "," mask character.

The group separator groups integer digits according to the sizes in pentaho.data.spec.INumberFormatStyle#groupSizes.

Grouping can be disabled, independently of the mask, by specifying "".

The default value is ",".

groupSizes : Array.<number>

The array of group sizes.

The group sizes array must contain at least one element.

The last group is repeated indefinitely.

The default value is [3].

negativeSign : string

The negative sign character.

The negative sign is used to indicate a negative number when a mask does not have a negative values section.

The negative sign is placed leftmost in the resulting string.

The negative sign is also used for showing a negative exponent, in scientific notation.

The default value is "-".

currency : string

The currency symbol to use in place of the "¤" mask character.

The currency sign, ¤, is a character used to denote an unspecified currency. Its unicode is U+00A4 and its HTML entities are &amp;#164; and &amp;curren;

See http://en.wikipedia.org/wiki/Currency_sign_(typography) for more information on the currency sign character.

The default value is "$".

integerPad : string

The character to use in place of a "0" mask character in the integer part.

The default value is "0".

fractionPad : string

The character to use in place of a "0" mask character in the fractional part.

The default value is "0".

abbreviations : string

The possible abbreviations to use when abbreviating the integer part.

Abbreviations are output in place of the "A" or "Abbreviation" mask macros.

The first abbreviation is used for the thousands unit, the second to the millions unit, ...

Any number of abbreviations can be specified.

The default value is ["k", "m", "b", "t"].

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

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

Example

The default number format style specification

 var numberFormatStyleSpec = {
 integerPad: "0",
 fractionPad: "0",
 decimal: ".",
 group: ",",
 groupSizes: [3],
 abbreviations: ["k", "m", "b", "t"],
 negativeSign: "-",
 currency: "$"
 };