Guest User

Untitled

a guest
Feb 24th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. var xl = require('excel4node');
  2.  
  3. var wb = new xl.Workbook();
  4. var ws = wb.addWorksheet('test');
  5.  
  6. // Create a reusable style
  7. var style = wb.createStyle({
  8. numberFormat: '#.00%; -#.00%; -'
  9. });
  10.  
  11. ws.cell(1,1).number(10).style(style); // displays as 1000.00%
  12. ws.cell(2,1).number(1).style(style); // displays as 100.00%
  13. ws.cell(3,1).number(.1).style(style); // displays as 10.00%
  14. ws.cell(4,1).number(.001).style(style); // displays as .10%
  15.  
  16. wb.write('NumFormat.xlsx');
Add Comment
Please, Sign In to add comment