Please try something like:
   printf "%08.2f\n" 3.14

For the documentation:
   man 3 printf

Enjoy the day!

Paul


On Thu, Sep 5, 2013 at 11:44 AM, Bauer, Bobby (NIH/CIT) [E] <
[email protected]> 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?
>
> Thanks
> Bobby Bauer
> Center for Information Technology
> National Institutes of Health
> Bethesda, MD 20892-5628
> 301-594-7474
>
>
>
> ----------------------------------------------------------------------
> 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