Menu
Download Free Trial
Table of contents

Format Object

Format object defines the way how numeric values are formatted in the component. It contains the following number format parameters:

  • name – String. It identifies the format in the report, thus, it should be unique. The default is "", which means that this number format is a default one and it is applied to all the measures for which the specific number format is not set.
  • thousandsSeparator – String. The default is " " (space).
  • decimalSeparator – String. The default is ".".
  • decimalPlaces – Number. The exact number of decimals to show in the fractional part of a number after the decimal separator. The default is -1, which means that the number will be shown as is.
  • maxDecimalPlaces – Number. The maximum number of decimals to show in the fractional part of a number after the decimal separator. The default is -1, which means the number will be shown as is.
  • maxSymbols – Number. The maximum number of symbols in a cell. The default is 20.
  • currencySymbol – String. The symbol which is shown near the value (currency symbol, hours, percent, etc.). The default is "".
  • currencySymbolAlign – String. The alignment of the currency symbol. It can be "left" or "right". The default is "left".
  • isPercent – Boolean. It allows to format data as percentage. The behavior is the same as in Excel. The default is false. Set isPercent to true and numbers will be multiplied by 100 and % symbol will be added. For example, 0.56 will be changed to 56%. Please note, if % is set as currencySymbol, setting isPercent to true will not multiply numbers by 100.
  • nullValue – String. It defines how to show null values in the grid. The default is "".
  • infinityValue – String. It defines how to show infinity values in the grid. The default is "Infinity".
  • divideByZeroValue – String. It defines how to show divided by zero values in the grid. The default is "Infinity".
  • textAlign – String. The alignment of formatted values in cells on the grid: "right" or "left". The default is "right".

Set Format Object via setFormat() API call. Get this object using getFormat().