emacs-orgmode
[Top][All Lists]
Advanced

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

Preserving leading zeros


From: William Denton
Subject: Preserving leading zeros
Date: Sun, 28 May 2023 10:46:45 -0400 (EDT)
User-agent: Alpine 2.22 (DEB 394 2020-01-19)

I'm thinking about moving a personal library catalogue system into Org. This would involve ISBNs, and when ISBNs had 10 digits some would have leading zeros. It turns out leading zeros are removed when something looks like a number.

#+name:isbn
| 0006145396 |

#+begin_src shell :results output :var string=isbn
echo $string
#+end_src

#+RESULTS:
: 6145396

I looked at org-babel-read, which calls org-babel--string-to-number ("If STRING represents a number return its value"), so it looks like that's always going to happen.

I could use a hack like prepending an X and then removing it later, but that's a bit ugly. Has anyone had this problem and worked around it some other way?



Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 424.57 ppm (Mauna Loa Observatory, 2023-05-27)

reply via email to

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