The properties of number columns are as follows.
- Default Properties : name, text, type, editable, visible, align, width.
- Number Properties : scale, roundType, fixedScale, showZero, thousandChar, decimalChar, currencyChar.
- The basic properties are the same as string columns. Let's learn about Number and Currency Columns.
- The difference between number and currency is whether or not the symbol (ex: $, €, ¥) is used.
- The first digit of scale does not work when loading data, but works when entering data.
// Examples
let columns = [
{ name : "amt1", header: { text:"amt1" }, type : 'number', currencyChar: '$', scale : '18' }
, { name : "amt2", header: { text:"fixedScale: true" }, type : 'number', scale : '18,4', fixedScale: true }
, { name : "amt3", header: { text:"fixedScale: false" }, type : 'number', scale : '18,2', fixedScale: false }
, { name : "amt4", header: { text:"amt4" }, type : 'number', scale : '18,2', decimalChar: '^' , roundType: 'floor' }
, { name : "amt5", header: { text:"amt5" }, type : 'number', scale : '18,2', thousandChar: '#' , roundType: 'ceil' }
];
let grid1 = new TbsGrid('grid1');
let options = {}; // This option can only set the default option.
grid1.setGrid(columns, options);
grid1.setData(grid_data);