emacs-orgmode
[Top][All Lists]
Advanced

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

Calc/TBLFM: how to conditionally insert hours:minutes?


From: Chris Keschnat
Subject: Calc/TBLFM: how to conditionally insert hours:minutes?
Date: Sat, 23 Sep 2023 21:38:25 +0200

Hi,
I am trying to understand how to set hours:minutes values in tables 
conditionally.

Just setting hours directly works:

| 40:03:00 |
| 40:03:00 |
| 40:03:00 |
#+TBLFM: $1=40:03;T

But when doing that conditionally (first row different from the others),
I do not understand the behavior:

This seemed to work:

| 19:55:00 |
| 40:03:00 |
| 40:03:00 |
#+TBLFM: $1=if(@# <= 1, 19:55, 40:03);T

But after adjusting the minutes, this happens:

| 19:55:00 |
| 00:00:40 |
| 00:00:40 |
#+TBLFM: $1=if(@# <= 1, 19:55, 40:01);T

What would be the correct way to do this?

PS: I have found that the same happens when I add parentheses:

| 40:03:00 |
| 40:03:00 |
| 40:03:00 |
#+TBLFM: $1=(40:03);T

| 00:00:40 |
| 00:00:40 |
| 00:00:40 |
#+TBLFM: $1=(40:01);T

PPS: I came across this when trying to understand the formulas here
https://github.com/clange/org-mode

Thanks
Chris



reply via email to

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