This works, thanks and I got  the same from Paul. Never thought of using 'f' 

Bobby Bauer
Center for Information Technology
National Institutes of Health
Bethesda, MD 20892-5628
301-594-7474


-----Original Message-----
From: John Campbell [mailto:[email protected]] 
Sent: Thursday, September 05, 2013 1:18 PM
To: [email protected]
Subject: Re: A bash script question

Bobby Bauer from NIH (Not Invented Here) wrote:
> I've spent a nice part of the day trying to figure out how to pad a variable 
> with leading zeroes and still keep the decimal. The variable needs to be 
> formatted nnnnn.nn. Printf with a %d clobbers the decimal. Any suggestions 
> not using SED or AWK?

Hmmmmm...

Doesn't %08.2f work?

I'm not sure whether you need %+09.2f so you have a +/- as a prefix.

-soup

Thank you for the National Institutes of Health providing me the inspiration to 
doink with the TLA;  I needed a good laugh.

--
John R. Campbell         Speaker to Machines          souperb at gmail dot com
MacOS X proved it was easier to make Unix user-friendly than to fix Windows "It 
doesn't matter how well-crafted a system is to eliminate errors; Regardless  of 
any and all checks and balances in place, all systems will fail because,  
somewhere, there is meat in the loop." - me

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions, send email to 
[email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit http://wiki.linuxvm.org/

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/

Reply via email to