From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92640 invoked by alias); 26 Nov 2015 17:20:47 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 92619 invoked by uid 89); 26 Nov 2015 17:20:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mailout.ish.de Received: from mailout.ish.de (HELO mailout.ish.de) (80.69.98.252) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 26 Nov 2015 17:20:45 +0000 Received: from submit.unitybox.de (mailout.ish.de [80.69.98.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailout.ish.de (Postfix) with ESMTPS id 3p65Rn3s70zBN5hG for ; Thu, 26 Nov 2015 18:19:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by submit.unitybox.de (Postfix) with ESMTP id 3p65T521FFz6dtBQ for ; Thu, 26 Nov 2015 18:20:41 +0100 (CET) Received: from submit.unitybox.de ([127.0.0.1]) by localhost (submit.unitybox.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id w6OJiB1KcGwB for ; Thu, 26 Nov 2015 18:20:41 +0100 (CET) X-Abuse-ID: hremUFXL0y-8240@umkbw.customer Received: from ish.de (ip-94-114-224-114.unity-media.net [94.114.224.114]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by submit.unitybox.de (Postfix) with ESMTPSA id 3p65T46ZJNz6dtB1; Thu, 26 Nov 2015 18:20:40 +0100 (CET) From: Helmut Karlowski To: cygwin@cygwin.com Cc: cygwin@cygwin.com Subject: Re: Rounding off real (floating point) values - bash to awk Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In-Reply-To: References: Date: Thu, 26 Nov 2015 17:27:00 -0000 Message-Id: <20151126182041.6373EEF8.helmut.karlowski@ish.de> MIME-Version: 1.0 Outgoingd: 0.4.0_m1 X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00434.txt.bz2 --------------------------------------------------- > 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 #4: printf "%3.0f\n" 3.7 -Helmut -- 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