Number stored as Text error
See original GitHub issueIn my code I’m formatting the numbers to strings with commas separators this way: num.toLocaleString('en')
in order to get something like that:
The problem is that this green sign appears and writes me “Number stored as Text” and that I need to convert it back to number manually. I didn’t find a feature that enables excel 1000 separator or ignores errors in this package. Is there something to do with it?
Issue Analytics
- State:
- Created 6 years ago
- Comments:11
Top Results From Across the Web
Fix text-formatted numbers by applying a number format
Click the File tab. · Under Help, click Options. · In the Excel Options dialog box, click the Formulas category. · Under Error...
Read more >How to Fix All Number Stored as Text in Excel (6 Easy Solutions)
6 Solutions to Fix All Number Stored as Text in Excel · First, add a new column. · After that, select the first...
Read more >Fixing Numbers Stored as Text | Getting Data onto a ... - InformIT
When numbers in a sheet are being stored as text, Excel lets you know by placing a green triangle in the cell (if...
Read more >How to Fix Numbers Stored as Text in Excel - Officetuts
To resolve the issue, all you need to do is select the range, then go to Data >> Text to Columns: When we...
Read more >What's the deal with numbers being stored as text in Microsoft ...
Somehow you inadvertently caused Excel to see your numbers as text. This can happen for a few reasons: You imported it from a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
When he says you need to return number, it means the type of data you are putting into exceljs for that row or column, should be a Number and not a string. Instead of using the toLocaleString, maybe you can just write in code the format you want so that it is never a string and uses something else to place decimals etc. Like in angular, I use the number pipe: {{yourField | number: ‘1.2-2’}}
When he’s talking about number formats, numFmt, I am fairly sure he is referencing actual excel number formats, which is what you put into your code when exporting. You can read about excel number formats here: https://www.excel-easy.com/examples/custom-number-format.html
For me, I had been using the method toFixed() on my data to get 2 decimal places, and it was turning it into a string. I removed that to keep it as a number, and when exported to excel, I no longer have the issue.
Hi, I was able to find solution for this. You have to return Number and numFmt should be #,#