This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Rounding off real (floating point) values - bash to awk


---------------------------------------------------
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]