emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: AW <alexander.willand@t-online.de>
To: emacs-orgmode@gnu.org
Cc: Michael Brand <michael.ch.brand@gmail.com>
Subject: Re: Format a whole column using ";%.2f" in orgtbl?
Date: Thu, 21 Jun 2012 12:15:26 +0200	[thread overview]
Message-ID: <3465224.sPDMcBHj5z@linux-nyil.site> (raw)
In-Reply-To: <CALn3zohVz3suddVRKV2YQpwgQN5YktEgVTuYUNFMVSyjRp3w8Q@mail.gmail.com>

Am Freitag, 15. Juni 2012, 19:01:35 schrieb Michael Brand:
> Hi Alexander
> 
> On Fri, Jun 15, 2012 at 4:34 PM, AW <alexander.willand@t-online.de> wrote:
> > [...]
> > 
> > Desired outoput:
> > | 100.00 | Value |
> > | 150.00 | Value |
> > 
> > #+TBLFM: $1=%s;%.2f
> > 
> > [...]
> 
> What you tried would be
> 
> | 100.00 | Value |
> | 150.00 | Value |
> 
> #+TBLFM: $1=$0;%.2f
> 
> $0 is the current table field. What I recommend is
> 
> | 100.00 | Value |
> | 150.00 | Value |
> 
> #+TBLFM: $1 = $0 +.0; f-2
> 
> because of the behavior I explained in the tables shown here:
> http://orgmode.org/worg/org-faq.html#table-float-fraction
> 
> Michael

O.K., thank you very much for your help. This is a nice trick!

Unfortunately, my tables have other formulas than only one:

| Values | Desc. |
|--------+-------|
| 100.00 | Value |
| 150.00 | Value |
|   250. | sum   |
|--------+-------|
|   500. | End   |
#+TBLFM: @4$1=@2$1+@3$1::@5$1=vsum(@I..@II)::$1=$0 +.0; f-2

I get at least every number in column 1 with a dot, but without ".00", as 
needed: 

*Do I have to ad '; f-2' to every formula?* 

And besides that, I've never seen this description "f-2". Is it explained 
somewhere for non-mathematicians? You know, if there are differences between 
this and ";%.2f", I should better be aware of them. 

Regards

Alexander

  reply	other threads:[~2012-06-21 10:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 14:34 Format a whole column using ";%.2f" in orgtbl? AW
2012-06-15 17:01 ` Michael Brand
2012-06-21 10:15   ` AW [this message]
2012-06-21 16:29     ` Michael Brand
2012-06-21 20:18       ` AW

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3465224.sPDMcBHj5z@linux-nyil.site \
    --to=alexander.willand@t-online.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=michael.ch.brand@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).