emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Preserving leading zeros
@ 2023-05-28 14:46 William Denton
  2023-05-28 17:01 ` Berry, Charles
  2023-05-29  8:04 ` Ihor Radchenko
  0 siblings, 2 replies; 5+ messages in thread
From: William Denton @ 2023-05-28 14:46 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 898 bytes --]

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)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-29  8:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-28 14:46 Preserving leading zeros William Denton
2023-05-28 17:01 ` Berry, Charles
2023-05-28 17:50   ` William Denton
2023-05-28 18:40     ` tomas
2023-05-29  8:04 ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).