emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] Re: org-babel: feature-request: allow table-cells to be passed


From: Marc-Oliver Ihm
Subject: [Orgmode] Re: org-babel: feature-request: allow table-cells to be passed as strings
Date: Mon, 04 Oct 2010 21:05:43 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.9) Gecko/20100317 SUSE/3.0.4-1.1.1 Thunderbird/3.0.4

Hello,

This would be such an example. The Input table contains some numbers,
the last of them larger than allowed for an integer.

As the result table show, the last one is converted to float thereby
using some precision.

I would like to see them all as strings.

with kind regards, Marc-Oliver Ihm


#+tblname: numbers

|                           1 |
|                           2 |
|                          12 |
|                          45 |
|                         166 |
|                    12567890 |
| 231231282371983279389999999 |


#+begin_src emacs-lisp :var numbers=numbers
(mapcar
 (lambda (line)
     (let ((number (car line)))
       (list number (type-of number))
       )
     )
   numbers)
#+end_src

#+results:
|                      1 | integer |
|                      2 | integer |
|                     12 | integer |
|                     45 | integer |
|                    166 | integer |
|               12567890 | integer |
| 2.3123128237198328e+26 | float   |




Am 04.10.2010 15:30, schrieb Eric Schulte:
> Hi,
> 
> Could you send an example of the contents of such a cell, and what it is
> converted to?  Maybe it will be possible to improve the parsing of
> numerals in Babel s.t. we don't lose precision in these cases.
> 
> Thanks -- Eric
> 
> Marc-Oliver Ihm <address@hidden> writes:
> 
>> Hello !
>>
>> Currently org-babel, when passing a table as input to a
>> source-code-block, behaves like this:
>> If the cell looks like a number, it will be converted to an integer or a
>> float. Otherwise the cell-content is passed unconverted as a string.
>>
>> Now, dealing with very large numbers (which I want to process with
>> calc), I found this behavior annoying, because babel converts my large
>> numbers to float, loosing precision in the process.
>>
>> Now my request would be, to have a switch (maybe as a header argument)
>> which would tell babel to pass all cells as unconverted strings.
>>
>> I have checked the documentation and the sources and have not been able
>> to find such a switch.
>>
>>
>> with kind regards, Marc-Oliver Ihm
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> address@hidden
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]