From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/53653 Path: news.gmane.org!not-for-mail From: batela Newsgroups: gmane.comp.tex.context Subject: format float numbers in luatex Date: Sat, 24 Oct 2009 17:59:47 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v624) Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1256457131 5856 80.91.229.12 (25 Oct 2009 07:52:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Oct 2009 07:52:11 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 25 08:52:04 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.50) id 1N1xtT-0003Me-NW for gctc-ntg-context-518@m.gmane.org; Sun, 25 Oct 2009 08:52:03 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4C3EAC9D66; Sun, 25 Oct 2009 08:46:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id IEXLeL1JyHJ1; Sun, 25 Oct 2009 08:46:13 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 11D8EC9CD4; Sun, 25 Oct 2009 08:43:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7FB6BC9A70 for ; Sat, 24 Oct 2009 18:59:19 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id j3-fBK0I4XrT for ; Sat, 24 Oct 2009 18:59:08 +0200 (CEST) Original-Received: from relay4.ptmail.sapo.pt (relay4.ptmail.sapo.pt [212.55.154.24]) by balder.ntg.nl (Postfix) with SMTP id B4092C9A41 for ; Sat, 24 Oct 2009 18:59:07 +0200 (CEST) Original-Received: (qmail 9829 invoked from network); 24 Oct 2009 17:00:04 -0000 Original-Received: from unknown (HELO sapo.pt) (10.134.37.162) by relay4 with SMTP; 24 Oct 2009 17:00:04 -0000 Original-Received: (qmail 30481 invoked from network); 24 Oct 2009 17:00:05 -0000 X-AntiVirus: PTMail-AV 0.3-0.95.1 X-Scan-Status: AV clean (0.00808 seconds); AS clean (0.27632 seconds); Original-Received: from unknown (HELO [192.168.2.101]) (as9938358@sapo.pt@[188.80.4.240]) (envelope-sender ) by mta12 (qmail-ldap-1.03) with SMTP for ; 24 Oct 2009 17:00:05 -0000 X-Mailer: Apple Mail (2.624) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:53653 Archived-At: Dear Sirs, I'm looking a way to format float numbers. For example \ctxlua{text.print(sqrt(2))} give me 1.41421356237309504880 but i want 1.414. Is there a way to format real numbers. Note: I had tried \ctxlua{a = sqrt(a) ; aformat = string.format("0.3%f", a) ; text.print(aformat)} but that don't work because the % character thanks a lot Have a nice day jorge ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________