Attempting to write sequential line numbers in a cell like this: '0001'. When a user adds a line and enters line number '0002', Excel will re-format to a number: 2
If I change the cell's number format to Text (in excel) entering the value '0002' will persist.
I attempted to assign a number format when defining the column:
sheet.columns = [{header: 'lineNo', width: 8, style: {alignment: {horizontal: 'right'},numFmt:'Text'}},{...}]
Excel will treat this as a custom format and when you enter '0002' in to the cell, it will reformat to 'T1900xt' with the formula bar value = '1/2/1900'
Tried numFmt:'text' as well with no difference in result.
Love this library BTW.
Found the answer in this guide.
for text: numFmt: '@'
How to retrieve the Cell Text as Displayed in Excel?
for currency 340 , displayed value is $340.00 but cell.value and cell.text both return 340 only. So how to get the value with number format?
how to convert the string numbers to int numbers
Most helpful comment
Found the answer in this guide.
for text:
numFmt: '@'