emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Samuel Wales <samologist@gmail.com>
To: Nick Dokos <ndokos@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Org table: emphasizing calculated cell
Date: Fri, 27 Aug 2021 15:05:19 -0700	[thread overview]
Message-ID: <CAJcAo8t6C+Qsqm3Q0_r8Tpo04E4aSiBUxq208o1H1Lg_Gjcbdg@mail.gmail.com> (raw)
In-Reply-To: <87bl5ihcqg.fsf@alphaville.usersys.redhat.com>

out of curiosity, do common spreadsheets implement the feature of
distinguishing calculated results from entered values?  i find myself
wanting that too, but don't know if that desire is unusual.


On 8/27/21, Nick Dokos <ndokos@gmail.com> wrote:
> Jarmo Hurri <jarmo.hurri@iki.fi> writes:
>
>> Greetings Norwid.
>>
>> Norwid Behrnd <nbehrnd@yahoo.com> writes:
>>
>>> try extending the format of the table formula with asterisks, i.e.
>>>
>>> ```
>>> | quantity |  value |
>>> |----------+--------|
>>> | A        |      1 |
>>> | B        |      3 |
>>> |----------+--------|
>>> | *C*      | *0.33* |
>>>
>>> #+TBLFM:  @4$2=@-2/@-1; *%.2f*
>>> ```
>>>
>>> Subsequently, issue the call ```C-c *``` for an update while the
>>> cursor is within the table.  This approach works well enough for me
>>> (equally for emphasis with enclosing forward slashes, or underscores)
>>> in Emacs' native display (backed by elpa-org 9.4.0) as well as for a
>>> subsequent export into .html and display (e.g., in Firefox), or .tex.
>>
>> Excellent, this is a working solution for the basic case. Much
>> appreciated!
>>
>> This solution seems to change the contents of a cell, not only its
>> formatting. So the following, where I try to increase the value of "C"
>> by one, leads to an error:
>>
>> ```
>> | quantity | value  |
>> |----------+--------|
>> | A        | 1      |
>> | B        | 3      |
>> |----------+--------|
>> | *C*      | *0.33* |
>> | D        | #ERROR |
>>
>> #+TBLFM: @4$2=@-2/@-1; *%.2f*::@5$2=@-1+1
>> ```
>>
>> I wonder if there is a way around this effect?
>>
>
> The error here is that `*0.33*' is no longer a string that can be converted
> to a number,
> so the calculator barfs.
>
> TUrn on formula debugging with `C-c {' and try evaluating it.
>
> --
> Nick
>
> "There are only two hard problems in computer science: cache
> invalidation, naming things, and off-by-one errors." -Martin Fowler
>
>
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html


  reply	other threads:[~2021-08-27 22:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26  5:47 Org table: emphasizing calculated cell Jarmo Hurri
2021-08-26  7:51 ` Norwid Behrnd
2021-08-27  4:07   ` Jarmo Hurri
2021-08-27  8:12     ` Norwid Behrnd
2021-08-28  4:42       ` Jarmo Hurri
2021-08-27 20:08     ` Nick Dokos
2021-08-27 22:05       ` Samuel Wales [this message]
2021-08-28  4:33       ` Jarmo Hurri

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=CAJcAo8t6C+Qsqm3Q0_r8Tpo04E4aSiBUxq208o1H1Lg_Gjcbdg@mail.gmail.com \
    --to=samologist@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=ndokos@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).