emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Alignment Regexp Should Recognize Currencies
@ 2011-09-09 15:01 Daniel E. Doherty
  2011-10-22 10:43 ` Bastien
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel E. Doherty @ 2011-09-09 15:01 UTC (permalink / raw)
  To: Org-mode List


All,

I noticed that the regular expression for recognizing what columns are
numeric in a table for purposes of right-aligning does not pick up
dollar values with commas.

For example, $23,821,415.18 would be treated as "text" and left-aligned,
which I don't believe is what one would expect.

It can be fixed by customizing the variable org-table-number-regexp,
like so:

^\([<>]?\(\$ *\)?[-+^.,0-9]*[0-9][-+^.0-9eEdDx()%:]*\| ... \)$
         ^^^^^^^^     ^
Adding the underlined parts.

My question is should this not be the default, perhaps with the Euro
symbol and other likely currency symbols added in?

Regards,
-- 


====================================================
Daniel E. Doherty

Up the airy mountain,
Down the rushy glen,
We daren't go a-hunting,
For fear of little men.
          --- William Allingham (Donegal, Ireland)

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

* Re: Alignment Regexp Should Recognize Currencies
  2011-09-09 15:01 Alignment Regexp Should Recognize Currencies Daniel E. Doherty
@ 2011-10-22 10:43 ` Bastien
  2011-10-22 14:07   ` Daniel E. Doherty
  0 siblings, 1 reply; 3+ messages in thread
From: Bastien @ 2011-10-22 10:43 UTC (permalink / raw)
  To: Daniel E. Doherty; +Cc: Org-mode List

Hi Daniel,

Daniel E. Doherty <ded-law@ddoherty.net> writes:

> I noticed that the regular expression for recognizing what columns are
> numeric in a table for purposes of right-aligning does not pick up
> dollar values with commas.
>
> For example, $23,821,415.18 would be treated as "text" and left-aligned,
> which I don't believe is what one would expect.

To me, values that are right-aligned are those who are ready for further
computation, and letting $3 be right-aligned would be confusing.

But I understand your need.

Carsten, what do you think?

-- 
 Bastien

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

* Re: Alignment Regexp Should Recognize Currencies
  2011-10-22 10:43 ` Bastien
@ 2011-10-22 14:07   ` Daniel E. Doherty
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel E. Doherty @ 2011-10-22 14:07 UTC (permalink / raw)
  To: Bastien; +Cc: Org-mode List

Bastien,

I thought this issue was going to die.  Thanks for reviving it.  I am
still interested and would love to hear Carsten's views.

Maybe numeric fields could have the grouping character (,) and currency
symbols stripped before being used for coumputation?

Regards,

At Sat, 22 Oct 2011 12:43:55 +0200,
bzg wrote:
> 
> Hi Daniel,
> 
> Daniel E. Doherty <ded-law@ddoherty.net> writes:
> 
> > I noticed that the regular expression for recognizing what columns are
> > numeric in a table for purposes of right-aligning does not pick up
> > dollar values with commas.
> >
> > For example, $23,821,415.18 would be treated as "text" and left-aligned,
> > which I don't believe is what one would expect.
> 
> To me, values that are right-aligned are those who are ready for further
> computation, and letting $3 be right-aligned would be confusing.
> 
> But I understand your need.
> 
> Carsten, what do you think?
> 
> -- 
>  Bastien

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

end of thread, other threads:[~2011-10-22 14:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-09 15:01 Alignment Regexp Should Recognize Currencies Daniel E. Doherty
2011-10-22 10:43 ` Bastien
2011-10-22 14:07   ` Daniel E. Doherty

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).