LibreOffice Calc - Disable rounding

There are a ton of threads on this topic, but no simple and definitive answers.

Can someone please tell me how to permanently disable cell rounding on the .csv file which is created by script?

Basically, '377635637222436751' is being converted to '377635637222437000' automatically and that isn't really acceptable for my needs.

I've tried this:
Tools->Options->Calc->Calculate "Precision as shown"

and this:
Format > Cells > Numbers > Category > (scroll down for) Text.
(but considering my script creates the .csv -- this option isn't very good since it must be done after the file is created)

And neither is working. The number stays rounded -- even after formatting the column after the file is created.

Does anyone have any suggestions?


Solution 1:

For what I know, LibreOffice has no arbitrary precision numbers (decimal or integers). So if the number exceeds the range of a long integer it is stored as an IEEE754 number and so it has a limited precision.

So basically you can't do calculations with arbitrary precision in Calc, and if you want to read the long number as a number you will have it rounded off.

If you do not need to do calculations, use a string; put in your csv:

,
,
,12345678901234678901234567890
,"123456789012345678901234567890"

(notice the quotation marks) and then when reading it be sure to add "quoted field as text" and the correct text delimiter:

importing csv

...and you have

result

Now --- if you touch, transform, eval the string --- you will have the rounding kicking in again.

Maybe you can use currency type which is a 64 bit integer, but as far as I know there is no way to force that via csv.