all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Nick Dokos <ndokos@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Variable table length
Date: Mon, 03 Jun 2013 15:15:14 -0400	[thread overview]
Message-ID: <87k3mbqa4d.fsf@pierrot.dokosmarshall.org> (raw)
In-Reply-To: 20130603200701.36812e5a@aga-netbook

Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:

> Dnia 2013-06-03, o godz. 16:32:20
> Michael Brand <michael.ch.brand@gmail.com> napisał(a):
>
>> Hi Marcin
>> 
>> On Mon, Jun 3, 2013 at 3:38 PM, Michael Brand
>> <michael.ch.brand@gmail.com> wrote:
>> > I would use one row per payback and manually add/remove rows until
>> > the last row is the only one with a different sign for the floating
>> > loan.
>> 
>> Forgot to mention that if you don't need all the intermediate steps
>> per payback rate then you can of course simply use the annuity
>> functions from Emacs Calc:
>> (info "(calc) Related Financial Functions")
>> or
>> http://www.gnu.org/software/emacs/manual/html_node/calc/Related-Financial-Functions.html
>
> Thanks, I am aware of that - but what I want is actually a table (I'm
> teaching an introductory course in financial mathematics).
>

Use babel perhaps? Not sure what your inputs are and what your table
should look like but you could use something like this to produce a
skeleton table of the right length and a set of column formulas (nb:
fake ones used below), then C-C C-c on the #+tblfm: line to calculate
the rest of the table:

--8<---------------cut here---------------start------------->8---
#+begin_src sh :results raw :var n=20
echo "#+name: amorttable"
echo "|month | interest | principal | balance |"
for i in $(seq 1 $n)
do
   echo "| $i ||||"
done
echo '#+tblfm: $2 = 2 * $1 :: $3 = 3 * $1 :: $4 = 4 * $1'
#+end_src
--8<---------------cut here---------------end--------------->8---

-- 
Nick

      reply	other threads:[~2013-06-03 19:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-03 12:54 Variable table length Marcin Borkowski
2013-06-03 13:38 ` Michael Brand
2013-06-03 14:32   ` Michael Brand
2013-06-03 18:07     ` Marcin Borkowski
2013-06-03 19:15       ` Nick Dokos [this message]

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k3mbqa4d.fsf@pierrot.dokosmarshall.org \
    --to=ndokos@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.