Documentation

@kanunilabs/pivotgrid-react


@kanunilabs/pivotgrid-react / PivotNumberFormat

Interface: PivotNumberFormat

Number format options with a fixed text beside the number (B.115).

{ minimumFractionDigits: 2, maximumFractionDigits: 2, suffix: ' ₺' } writes "1.234,50 ₺" in tr-TR (and "-1.234,50 ₺", "0,00 ₺"); Excel gets the number with the number format #,##0.00" ₺". The text is written as given, spaces included. A prefix goes after the minus sign, as Excel writes "$"#,##0.00: "-$1,234.50". The cells, their screen-reader text, the header filter list, chart tooltips, getSummaryTable({ display: true }), CSV, PDF, print and the footer's selection statistics (when every selected cell is this field's; not the count) write the same text. To change it at run time give the field a new format object (setFields).

Give minimumFractionDigits / maximumFractionDigits. Without them Excel gets General" ₺": the number with the decimals it has and no thousands separator ("1234.5 ₺" where the screen reads "1.234,5 ₺"). No single Excel code matches Intl's default (grouping, up to three decimals) without a decimal point left after whole numbers ("1.235, ₺"), so General is the closest; the column is made wide enough that Excel does not round it.

Extends

  • NumberFormatOptions

Properties

prefix?

optional prefix?: string

Text before the number (after its minus sign).


suffix?

optional suffix?: string

Text after the number.