You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Cem Dayanik (Ibtech-Software Infrastructure)" <ce...@ibtech.com.tr> on 2017/01/31 06:11:47 UTC

xssf writing large numbers

While I searched quite a lot in net, I havent able to find an exact solution.

I havent able to write a number with 16 digits.

Ex) 3340005973272861

It loses precision, last digit to be exact. (and it doesnt seem a problem about bigdecimal to double conversion? or is it?)
Double d = Double.parseDouble("3340005973272861");
System.out.println(d.longValue()); // this writes the exact output

Is this  XSSF limitation?

Is there a solution other than writing it as a string?

Thx








Bu e-posta'n?n i?erdi?i bilgiler (ekleri dahil olmak ?zere) gizlidir. Onay?m?z olmaks?z?n ???nc? ki?ilere a?iklanamaz. Bu mesaj?n g?nderilmek istendi?i ki?i de?ilseniz, l?tfen mesaj? sisteminizden derhal siliniz. IBTech A.?. bu mesaj?n i?erdi?i bilgilerin do?rulu?u veya eksiksiz oldu?u konusunda bir garanti vermemektedir. Bu nedenle bilgilerin ne ?ekilde olursa olsun i?eri?inden, iletilmesinden, al?nmas?ndan, saklanmas?ndan sorumlu de?ildir. Bu mesaj?n i?eri?i yazar?na ait olup, IBTech A.?.'nin g?r??lerini i?ermeyebilir.

The information contained in this e-mail (including any attachments)is confidential. It must not be disclosed to any person without our authority. If you are not the intended recipient, please delete it from your system immediately. IBTech A.S. makes no warranty as to the accuracy or completeness of any information contained in this message and hereby excludes any liability of any kind for the information contained therein or for the information transmission, reception, storage or use of such in any way whatsoever. Any opinions expressed in this message are those of the author and may not necessarily reflect the opinions of IBTech A.S.

Re: xssf writing large numbers

Posted by Javen O'Neal <ja...@gmail.com>.
Are you able to save numbers that large in Excel?

On Jan 30, 2017 10:12 PM, "Cem Dayanik (Ibtech-Software Infrastructure)" <
cem.dayanik@ibtech.com.tr> wrote:

> While I searched quite a lot in net, I havent able to find an exact
> solution.
>
> I havent able to write a number with 16 digits.
>
> Ex) 3340005973272861
>
> It loses precision, last digit to be exact. (and it doesnt seem a problem
> about bigdecimal to double conversion? or is it?)
> Double d = Double.parseDouble("3340005973272861");
> System.out.println(d.longValue()); // this writes the exact output
>
> Is this  XSSF limitation?
>
> Is there a solution other than writing it as a string?
>
> Thx
>
>
>
>
>
>
>
>
> Bu e-posta'n?n i?erdi?i bilgiler (ekleri dahil olmak ?zere) gizlidir.
> Onay?m?z olmaks?z?n ???nc? ki?ilere a?iklanamaz. Bu mesaj?n g?nderilmek
> istendi?i ki?i de?ilseniz, l?tfen mesaj? sisteminizden derhal siliniz.
> IBTech A.?. bu mesaj?n i?erdi?i bilgilerin do?rulu?u veya eksiksiz oldu?u
> konusunda bir garanti vermemektedir. Bu nedenle bilgilerin ne ?ekilde
> olursa olsun i?eri?inden, iletilmesinden, al?nmas?ndan, saklanmas?ndan
> sorumlu de?ildir. Bu mesaj?n i?eri?i yazar?na ait olup, IBTech A.?.'nin
> g?r??lerini i?ermeyebilir.
>
> The information contained in this e-mail (including any attachments)is
> confidential. It must not be disclosed to any person without our authority.
> If you are not the intended recipient, please delete it from your system
> immediately. IBTech A.S. makes no warranty as to the accuracy or
> completeness of any information contained in this message and hereby
> excludes any liability of any kind for the information contained therein or
> for the information transmission, reception, storage or use of such in any
> way whatsoever. Any opinions expressed in this message are those of the
> author and may not necessarily reflect the opinions of IBTech A.S.
>

RE: xssf writing large numbers

Posted by "Cem Dayanik (Ibtech-Software Infrastructure)" <ce...@ibtech.com.tr>.
Thank you.



-----Original Message-----
From: Nick Burch [mailto:apache@gagravarr.org] 
Sent: Tuesday, January 31, 2017 9:18 AM
To: POI Users List <us...@poi.apache.org>
Subject: Re: xssf writing large numbers

On Tue, 31 Jan 2017, Cem Dayanik (Ibtech-Software Infrastructure) wrote:
> While I searched quite a lot in net, I havent able to find an exact 
> solution.
>
> I havent able to write a number with 16 digits.
>
> Ex) 3340005973272861

That's an excel limitation, or rather a limitation in the various Excel file formats. See https://support.microsoft.com/en-in/help/269370/last-digits-are-changed-to-zeroes-when-you-type-long-numbers-in-cells-of-excel

> Is there a solution other than writing it as a string?

As per the above Microsoft support article, if you want to keep using the XLS or XLSX file formats, a string is your only option. Other file formats avoid this limitation, though if Excel reads those files back in it'll often do the same truncating on them when loaded...

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org



Bu e-posta'nin i?erdigi bilgiler (ekleri dahil olmak 
?zere) gizlidir. Onayimiz olmaksizin ???nc? kisilere a?iklanamaz. Bu mesajin 
g?nderilmek istendigi kisi degilseniz, l?tfen mesaji sisteminizden derhal 
siliniz. IBTech A.S. bu mesajin i?erdigi bilgilerin dogrulugu veya eksiksiz 
oldugu konusunda bir garanti vermemektedir. Bu nedenle bilgilerin ne sekilde 
olursa olsun i?eriginden, iletilmesinden, alinmasindan, saklanmasindan sorumlu 
degildir. Bu mesajin i?erigi yazarina ait olup, IBTech A.S.'nin g?r?slerini 
i?ermeyebilir.

The information contained in this e-mail (including any 
attachments)is confidential. It must not be disclosed to any person without our 
authority. If you are not the intended recipient, please delete it from your 
system immediately. IBTech A.S. makes no warranty as to the accuracy or 
completeness of any information contained in this message and hereby excludes 
any liability of any kind for the information contained therein or for the 
information transmission, reception, storage or use of such in any way 
whatsoever. Any opinions expressed in this message are those of the author and 
may not necessarily reflect the opinions of IBTech 
A.S.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: xssf writing large numbers

Posted by Nick Burch <ap...@gagravarr.org>.
On Tue, 31 Jan 2017, Cem Dayanik (Ibtech-Software Infrastructure) wrote:
> While I searched quite a lot in net, I havent able to find an exact 
> solution.
>
> I havent able to write a number with 16 digits.
>
> Ex) 3340005973272861

That's an excel limitation, or rather a limitation in the various Excel 
file formats. See 
https://support.microsoft.com/en-in/help/269370/last-digits-are-changed-to-zeroes-when-you-type-long-numbers-in-cells-of-excel

> Is there a solution other than writing it as a string?

As per the above Microsoft support article, if you want to keep using the 
XLS or XLSX file formats, a string is your only option. Other file formats 
avoid this limitation, though if Excel reads those files back in it'll 
often do the same truncating on them when loaded...

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org