Hi Uwe

On Thu, Jun 22, 2017 at 9:56 AM, Uwe Brauer <o...@mat.ucm.es> wrote:

> #+TBLFM: $2=if("$1" == "nan", string(""), $1*0.15;%.1f);E
>
> And friends did not work any more
>
> | 3.25 | 0.5) |
> |      | 0.0) |
> #+TBLFM: $2=if("$1" == "nan", string(""), $1*0.15;%.1f);E

This is invalid syntax, what you meant would be:

| 3.25 | 0.5 |
|      | 0.0 |
#+TBLFM: $2=if("$1" == "nan", string(""), $1*0.15);E %.1f

To preserve empty columns when reformatting you can use the Calc
formatter:

| 3.25 | 0.5 |
|      |     |
#+TBLFM: $2=if("$1" == "nan", string(""), $1*0.15);E f-1

    (info "(org) Formula syntax for Calc")

    `if("$1" == "nan" || "$2" == "nan", string(""), $1 + $2); E f-1'
      Sum of the first two columns.  When at least one of the input
      fields is empty the Org table result field is set to empty.  `E'
      is required to not convert empty fields to 0.  `f-1' is an
      optional Calc format string similar to `%.1f' but leaves empty
      results empty.

See also
"Which float format shows the fraction part also when the latter is
zero?"
http://orgmode.org/worg/org-faq.html#table-float-fraction

Michael

Reply via email to