stephen-hardy/xlsx.js

Force value to be parsed as text?

LeachBogdan opened this issue · 1 comments

We have a very permissive phone no. field and would like all phone numbers to be parsed as text. Is there any way to do it?

I've managed to do it by adding a property (in my case forceString) to the cell when creating it and changing the string verification to also include it

if(val && typeof val === 'string' && !isFinite(val))

becomes

if( al && typeof val === 'string' && (!isFinite(val) || cell.forceString') 

at line 181.