> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 20, 2001 12:30 PM
> To: [EMAIL PROTECTED]
> Subject: formatting
> 
> 
> Hi there,
> I hope this a is a simple one,
> I am trying to format a number so I get it rounded up to 4 
> decimals then padded with 2 zeros afterwards,
> $test =  "142.09879543" ;
> $test = sprintf( "%.4f", $test);
> The output that I am looking for is
> 142.098800
> This will be done via a loop through a whole set of numbers

You would just add the 2 final zero's yourself:

   $test = sprintf('%.4f00', $test);

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to