Exporting (very) small numbers to Excel

Exporting (very) small numbers to Excel

jensptjenspt Posts: 3Questions: 0Answers: 0

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

  • allanallan Posts: 54,881Questions: 1Answers: 8,601 Site admin

    Can you give me an example please? Are your numbers already in exponential format or are they actual number types?

    Allan

  • jensptjenspt Posts: 3Questions: 0Answers: 0

    Hi!

    See this jsfiddle with working example. jsfiddle

    My numbers are already in exponential format when creating the datatable.

    Cheers

  • allanallan Posts: 54,881Questions: 1Answers: 8,601 Site admin

    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

  • allanallan Posts: 54,881Questions: 1Answers: 8,601 Site admin

    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

  • colincolin Posts: 12,881Questions: 0Answers: 2,198

    @jenspt - and here it is in action using the nightly releases.

    Colin

  • jensptjenspt Posts: 3Questions: 0Answers: 0

    Thanks for the reply both of you :)

Sign In or Register to comment.