From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: bike shifting - output decimal in percent Date: Sat, 18 May 2019 20:50:05 -0700 (PDT) Message-ID: <3b5af744-8dc6-42d0-9273-a8030e2b3443@default> References: <86mujjrzw0.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="64085"; mail-complaints-to="usenet@blaine.gmane.org" To: Emanuel Berg , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 19 05:50:37 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hSCqJ-000GUm-Ft for geh-help-gnu-emacs@m.gmane.org; Sun, 19 May 2019 05:50:35 +0200 Original-Received: from localhost ([127.0.0.1]:43392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSCqD-0000Eb-NC for geh-help-gnu-emacs@m.gmane.org; Sat, 18 May 2019 23:50:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hSCpz-0000ET-Mf for help-gnu-emacs@gnu.org; Sat, 18 May 2019 23:50:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hSCpy-0005KW-T4 for help-gnu-emacs@gnu.org; Sat, 18 May 2019 23:50:15 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:53472) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hSCpy-0005Fj-KM for help-gnu-emacs@gnu.org; Sat, 18 May 2019 23:50:14 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4J3nIdF111207; Sun, 19 May 2019 03:50:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2018-07-02; bh=XkE5/70plXQnipOj+V9kWMHrXdglXjNC+r2RPFTPQDs=; b=kgRdGYAz0mAVlYKEE0WO3qHCZ0lGF+onPDXbcMum4+ZqOydk+yy39BYfV79n9rmonSA9 of/dDOjqaN4m9vdOnsz6w445mj77qrcbmZJh5p3XAi3AyqsPDz656LEPx91mmdlYdAbv pv4bOg65Fux4UuU/fF1gJQz/7+VuG/Y57BM5AZMZ1ZZZ6W8/JhwT9HS3qA4dKjhRyVGP qVcnUuzik+GHAparkX1GZ/NYB290PpfknAb1Wu4BHltj2OBPc39ZDb6PmgAQezVgW5bi qFaEnWFi8B/UYu+NZk3BEBNSSSPAchc4PmEv8I8U/6N0YlX0KD40rj9CX4kh/4YN3HeD Jw== Original-Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2sj9ft279f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 19 May 2019 03:50:09 +0000 Original-Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4J3mMMo011954; Sun, 19 May 2019 03:50:09 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3030.oracle.com with ESMTP id 2sjucqtef9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 19 May 2019 03:50:08 +0000 Original-Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4J3o5eh003404; Sun, 19 May 2019 03:50:06 GMT In-Reply-To: <86mujjrzw0.fsf@zoho.eu> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4849.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905190026 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905190026 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.86 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:120525 Archived-At: > How do I output a decimal float digit > 0 <=3D x <=3D 1 into percent? ("A percentage?" > Correct English?) >=20 > But I wonder if/why-not there is/isn't > a built-in way to do it? Use function `format'. See `C-h f format' and (elisp) `Formatting Strings'. E.g. (setq foo 0.314159265358979) (format "%2.14g%%" (* 100.0 foo)) =3D> "31.459265358979%" (format "%2.2g%%" (* 100.0 foo)) =3D> "31%"