From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89539 invoked by alias); 26 Nov 2015 16:33:23 -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 89454 invoked by uid 89); 26 Nov 2015 16:33:22 -0000 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 Received: from mail-ig0-f178.google.com (HELO mail-ig0-f178.google.com) (209.85.213.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 26 Nov 2015 16:33:21 +0000 Received: by igcto18 with SMTP id to18so14899409igc.0 for ; Thu, 26 Nov 2015 08:33:19 -0800 (PST) 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) Received: by 10.79.108.74 with HTTP; Thu, 26 Nov 2015 08:33:19 -0800 (PST) In-Reply-To: References: Date: Thu, 26 Nov 2015 17:20:00 -0000 Message-ID: Subject: Re: Rounding off real (floating point) values - bash to awk From: Steven Penny To: cygwin@cygwin.com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-11/txt/msg00433.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 -- 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