Re: printf statement

From: Ed Morton (morton_at_lsupcaemnt.com)
Date: 06/07/05


Date: Tue, 07 Jun 2005 14:00:21 -0500


su wrote:
> Suppose we have to print the integer we are giving command
>
> printf "%d",variable
>
> if we have to print string values we are giving command
>
> printf "%s",stringvar
>
> In the same way if i have to print a values in a format like (99.06%) .
> How to acheive this format by using printf command ?
>

$ printf "(%.2f%%)\n" 99.06
(99.06%)

        Ed.