From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/6277 Path: main.gmane.org!not-for-mail From: Tobias Burnus Newsgroups: gmane.comp.tex.context Subject: Calculating in TeX Date: Wed, 5 Dec 2001 22:31:04 +0100 (CET) Sender: owner-ntg-context@let.uu.nl Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1035396811 9062 80.91.224.250 (23 Oct 2002 18:13:31 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:13:31 +0000 (UTC) Original-To: Xref: main.gmane.org gmane.comp.tex.context:6277 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:6277 Hi, I have a nice document where I need to perform small calculation (actually only calculating the average value): if((#1+#2+#3) != 0) (#1*1 + #2*2 + #3*3)/(#1+#2+#3) else "--" Now I was thinking where I could do so in TeX. (I think there are some macros in ConTeXt, but I cannot find them.) The output should be of the form "1{,}4" (i.e. separator is a {,} and I get one figure after the separator). If there is no good solution I will write a script which calculates this values and does a inline replacement of the data. -- This is not that error save since one needs to make sure that this script is run before texexec... Tobias