Format Object

Number format object is used for defining number formatting in the component.

Properties

NameTypeDescription
nameStringShould be unique because each format is identified by name. The default value is "". The default number format is applied to the measures for which no specific number format exists.
thousandsSeparatorStringSymbol used as a thousand separator. The default value is " " (space).
decimalSeparatorStringSymbol used as a decimal separator. The default value is ".".
decimalPlacesNumberDefines the number of decimals to appear after decimal separator in the fractional part of the number. The default value is -1, it means the number will not be changed and it will be shown in its original form.
maxDecimalPlacesNumberDefines the maximum number of decimals to appear after decimal separator in the fractional part of the number. The default value is -1, it means the number will not be changed and it will be shown in the original form.
maxSymbolsNumberDefines the maximum amount of symbols that can be displayed in a cell. The default value is 20.
currencySymbolStringSymbol which appears near the value (hours, percent, currency symbol etc.). The default value is "".
currencySymbolAlignStringDefines the positioning of a currency symbol. It could be either "left" or "right". The default value is "left".
isPercentBooleanEnables formatting data in percentage form. The behavior is similar to MS Excel. The default value is false. When setting isPercent to true, the numbers will be multiplied by 100 and % symbol will be appended to the result. For example, 0.42 will be converted to 42%. An important thing to note is if currencySymbol is set as % then setting the value of isPercent to true will not multiply the result by 100.
nullValueStringSpecifies the format of null values on the grid. The default value is "".
infinityValueStringSpecifies the format of infinity values on the grid. The default value is "Infinity".
divideByZeroValueStringSpecifies the format of values divided by zero. The default value is "Infinity".
textAlignStringDefines the positioning of formatted values in cells on the grid. The alignments are "right" or "left". The default value is "right".

Example

Set default number formatting: