"Jeff Oien" <[EMAIL PROTECTED]> wrote:
> I have a number like this 0.51 and I would like it to display without
> the leading 0. How can I do this? Thanks.

There are lots of solutions.

$num = 0.51;

$num_parts = explode( '.', $num );
$num_new = '.' . $num_parts[1];

Or if it's always going to be a number b/w 0 and 1 then you could use
substr() to get the part you want.  You could also use something like
ereg_replace().  Someone else may have a solution that's better.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to