NaN value produce an invalid document
See original GitHub issueWriting a NaN produce an error while opening the document.

To reproduce
xlsxPopulate.fromBlankAsync()
.then(workbook => {
const sheet = workbook.activeSheet().name('test');
sheet.cell(1, 1)
.style('numberFormat', '0.00')
.value(NaN);
return workbook.outputAsync().then(blob => {
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(blob, 'out.xlsx');
} else {
const url = window.URL.createObjectURL(blob);
const a = document.createElement('a');
document.body.appendChild(a);
a.href = url;
a.download = 'out.xlsx';
a.click();
window.URL.revokeObjectURL(url);
document.body.removeChild(a);
}
});
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
TfidfVectorizer in scikit-learn : ValueError: np.nan is an invalid ...
I'm using TfidfVectorizer from scikit-learn to do some feature extraction from text data. I have a CSV file with a Score (can be...
Read more >NaN - JavaScript - MDN Web Docs
The global NaN property is a value representing Not-A-Number. ... where an invalid value is to be represented as a number (e.g. an...
Read more >pandas give a warning when working with np.NaN values #9950
NaN values, I get the following warning. Example: >>> import pandas ... RuntimeWarning: invalid value encountered in absolute abs_vals = np.abs(self.values) ...
Read more >How to Deal With NaN Values - Datatest
Dropping NaNs Before Validation¶ ... Sometimes it's OK to ignore NaN values entirely. If this is appropriate in your circumstance, you can simply...
Read more >is.nan Function, Count, Replace & Remove - Statistics Globe
How to handle NaN values in R - Example syntax - is.nan & is not nan ... However, if we try to run...
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 Free
Top 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

Just came across this, too. In this case, it would seem that writing nothing would be preferable, as that’s what was there before xml-populate parsed the file:
I don’t like the idea of writing a “NaN” string. Setting to #NUM? or throwing an exception are the only options that make sense to me. I’m open to arguments for one or the other…