emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Format a whole column using ";%.2f" in orgtbl?


From: AW
Subject: Re: [O] Format a whole column using ";%.2f" in orgtbl?
Date: Thu, 21 Jun 2012 12:15:26 +0200
User-agent: KMail/4.8.4 (Linux/3.4.2-28-desktop; KDE/4.8.4; x86_64; ; )

Am Freitag, 15. Juni 2012, 19:01:35 schrieb Michael Brand:
> Hi Alexander
> 
> On Fri, Jun 15, 2012 at 4:34 PM, AW <address@hidden> 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: @address@hidden@3$1::@5$1=vsum(@address@hidden)::$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 via email to

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