From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guido Van Hoecke Subject: Re: Using constants in columns Date: Sat, 17 Oct 2015 22:27:33 +0200 Message-ID: References: <877fmmsz49.fsf@ucl.ac.uk> <87vba6voyi.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c381e4c6ca06052252bf1b Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnY5F-0003VK-Kd for emacs-orgmode@gnu.org; Sat, 17 Oct 2015 16:28:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnY5E-0002Mb-KU for emacs-orgmode@gnu.org; Sat, 17 Oct 2015 16:28:05 -0400 Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:35071) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnY5E-0002MW-EN for emacs-orgmode@gnu.org; Sat, 17 Oct 2015 16:28:04 -0400 Received: by wicll6 with SMTP id ll6so49154375wic.0 for ; Sat, 17 Oct 2015 13:28:03 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Michael Brand Cc: orgmode --001a11c381e4c6ca06052252bf1b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 17 October 2015 at 20:00, Michael Brand wrote: > Hi Guido > > On Sat, Oct 17, 2015 at 1:47 PM, Guido Van Hoecke > wrote: > > I have not found a way to specify the vector in a constant. > > You can access the elements of the vector constant suggested by Eric > with Calc's subscript function: > > #+CONSTANTS: vat=3D[1.15,1.21,1.40] > > | Amount | VAT | Total | > |--------+-----+--------| > | 100 | 1 | 115.00 | > | 100 | 2 | 121.00 | > #+TBLFM: $3 =3D $1 * subscr($vat, $2); %.2f > > =E2=80=8BThanks, Michael! I really should study the calc manual ;) Guido=E2=80=8B --001a11c381e4c6ca06052252bf1b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 1= 7 October 2015 at 20:00, Michael Brand <michael.ch.brand@gmail.co= m> wrote:
Hi Guido

On Sat, Oct 17, 2015 at 1:47 PM, Guido Van Hoecke <guivho@gmail.com> wrote:
> I have not found a way to specify the vector in a constant.

You can access the elements of the vector constant suggested by Eric=
with Calc's subscript function:

#+CONSTANTS: vat=3D[1.15,1.21,1.40]

| Amount | VAT |=C2=A0 Total |
|--------+-----+--------|
|=C2=A0 =C2=A0 100 |=C2=A0 =C2=A01 | 115.00 |
|=C2=A0 =C2=A0 100 |=C2=A0 =C2=A02 | 121.00 |
#+TBLFM: $3 =3D $1 * subscr($vat, $2); %.2f

=E2=80=8BThanks, Michael!

I really should= study the calc manual ;)

Guido=E2=80=8B=C2=A0


--001a11c381e4c6ca06052252bf1b--