Exporting (very) small numbers to Excel
Exporting (very) small numbers to Excel
Hi!
I have a datatable with very small numbers (e.g. 1.421532e-22) and when I use the Excel export button the numbers are not read by excel as numbers but as text. It is possible to use Excel's "Convert text to number" function once I have downloaded it but it decreases the user experience.
I want the Excel document to contain the same precision as my datatable which is why I cannot convert the number on my application to non-scientific before export.
I have tried to fix this in similar fashion as the forum posts that deal with very large number, however without any luck.
Replies
Can you give me an example please? Are your numbers already in exponential format or are they actual
number
types?Allan
Hi!
See this jsfiddle with working example. jsfiddle
My numbers are already in exponential format when creating the datatable.
Cheers
Thank you - yes, unfortunately at the moment our Buttons export does not support that format for numbers rendered into Excel.
I've created a task (DD-2338 on our internal tracker) for this and I'll update this post when it is done.
Allan
Hi,
I've been doing some other work in Buttons today, so I took a look at this and how XSLX uses exp numbers - it is actually a relatively simple change in Buttons, which will drop in the next release, which I'll tag up next week.
Allan
@jenspt - and here it is in action using the nightly releases.
Colin
Thanks for the reply both of you