Number Column
    
type scale default value description
number p f pass is not related to number, here 'p' means rendering pass
n thousands of commas use : int type
f thousands of commas use : float type
f1 thousands of commas use, round, ceil, floor at 1 decimal place
f2 thousands of commas use, round, ceil, floor at 2 decimal place
f3 thousands of commas use, round, ceil, floor at 3 decimal place
f5 thousands of commas use, round, ceil, floor at 5 decimal place
ff5 thousands of commas use, round, ceil, floor at 5 decimal place.
fixed decimal place (ex) ff1, ff2, ff3 etc
zero hide zero display : show, hide
scaleType round round, ceil, floor
        var column =  [
            { id: 'num' , name: 'p'  , type: 'number', scale: 'p' , scaleType: 'round', zero:'show', width: '100' },
            { id: 'n'   , name: 'n'  , type: 'number', scale: 'n' , scaleType: 'round', zero:'show', width: '100' },
            { id: 'f'   , name: 'f'  , type: 'number', scale: 'f' , scaleType: 'round', zero:'show', width: '100' },
            { id: 'f1'  , name: 'f1' , type: 'number', scale: 'f1', scaleType: 'round', zero:'hide', width: '100' },
            { id: 'f2'  , name: 'f2' , type: 'number', scale: 'f2', scaleType: 'round', zero:'show', width: '100' },
            { id: 'f3'  , name: 'f3' , type: 'number', scale: 'f3', scaleType: 'round', zero:'show', width: '100' },
            { id: 'f4'  , name: 'f4' , type: 'number', scale: 'f4', scaleType: 'round', zero:'show', width: '100' }
        ];
        var count = column.length;
        var data = [];
    
        var item = {};
        for (var i = 0; i < count; i++) {
            var col = column[i];
            if (col.id == 'p')   item[col.id] = 1000.12;
            if (col.id == 'n')   item[col.id] = 425123.01;
            if (col.id == 'f')   item[col.id] = 425123.1000;
            if (col.id == 'f1')  item[col.id] = 0;
            if (col.id == 'f2')  item[col.id] = 100.105;
            if (col.id == 'f3')  item[col.id] = -250.0005;
            if (col.id == 'ff3') item[col.id] = -40000000.0005;
        }
        data.push(item);   
        item = {}; 
        for (var i = 0; i < count; i++) {
            var col = column[i];
            if (col.id == 'p')   item[col.id] = 1000.312;
            if (col.id == 'n')   item[col.id] = 200.5;
            if (col.id == 'f')   item[col.id] = 2001000.0123;
            if (col.id == 'f1')  item[col.id] = 3000500.5;
            if (col.id == 'f2')  item[col.id] = 20000100.105;
            if (col.id == 'f3')  item[col.id] = 300200.1002;
            if (col.id == 'ff3') item[col.id] = 300200.1002;
        }
        data.push(item);
        
        wdtGrid.create('grid1', column);
        wdtGrid.setData('grid1', data);
    
email : widthart.mail@gmail.com
Copyrightⓒ2022 by wdtgrid.com. All rights reserved.