delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2015/11/26/11:33:42

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; q=dns; s=default; b=bZ
ydX1Jt6PkntUNLr9bvNTcKJar/PpyKt1Z/k2xL6PgGjQrZ+1EZHeU59S6A4joQ2w
cvK6bvwO3R/F6sMatQfrg3gx8ajGiUEvff6XAlYi8d+4SB30mcz9SqYe228C8FRa
or4ssSZXuXmiDyTbBFATOaE2tIaaYRQZJ6dTfHVP0=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:in-reply-to:references:date
:message-id:subject:from:to:content-type; s=default; bh=N006mxah
qiySl8stFM+fMea+RcY=; b=Zf+jFc5Ns6kK1mxhtQ3XC0b1824LpFKAmbyWK+Gh
+aye0MpRGyeMsOAAO+uOqkQu9gPQBXw3ZX97kvEPGiSPg80HQGHSVWOiQ5XU6jwT
2OU22JhzsS3oCDH/VIODZRwue6Gsgk75oXl+BdDK2iPjoIV4rDZx/PWQErARsgqe
e1U=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2
X-HELO: mail-ig0-f178.google.com
MIME-Version: 1.0
X-Received: by 10.50.12.42 with SMTP id v10mr3745441igb.85.1448555599320; Thu, 26 Nov 2015 08:33:19 -0800 (PST)
In-Reply-To: <CAAXzdLWK6hexdYcQM6CcvxVmE=ctyTqnYYHN_r+B6qC-8thVFw@mail.gmail.com>
References: <CAE3taFBHyMhcGB=ux5xYVxcLM13G2JRpuTyDG-NtuSrp=eOhmQ AT mail DOT gmail DOT com> <CAAXzdLWK6hexdYcQM6CcvxVmE=ctyTqnYYHN_r+B6qC-8thVFw AT mail DOT gmail DOT com>
Date: Thu, 26 Nov 2015 10:33:19 -0600
Message-ID: <CAAXzdLWU8LGBvnXM2Fa+TzFYAfoo0tQ0_kYQJXbJuqe930KhaQ@mail.gmail.com>
Subject: Re: Rounding off real (floating point) values - bash to awk
From: Steven Penny <svnpenn AT gmail DOT com>
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

On Thu, Nov 26, 2015 at 10:29 AM, Steven Penny wrote:
> echo 3.7 | awk '{printf "%.0f", $0}'

Another option

awk 'BEGIN {printf "%.0f", ARGV[1]}' 3.7

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019