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);

scale property.

  • Similar to numeric and decimal columns in a database.
  • Property value : (ex) '18, 0', '10', '10.5'

roundType property.

  • This is a property for applying round, ceil, and floor to decimal points.
  • Property value : round, ceil, floor.

fixedScale property.

  • Indicates whether the decimal place is fixed.
  • Default value is true.
  • Property value : true, false.

showZero property.

  • Indicate whether to show 0.
  • Property value : true, false.

thousandChar property.

  • Specifies the symbol used when specifying thousands..
  • Property value : (ex) . or , or space.

decimalChar property.

  • decimalChar basically uses data from the config file.
  • Property value : (ex) . or , or space.

currencyChar property.

  • currencyChar basically uses data from the config file.
  • Property value : (ex) $, €, ¥