> From: justin gruenberg [mailto:[EMAIL PROTECTED] 
> Subject: Re: [PHP] Changing numbers
> 
> 
> Curt Zirzow wrote:
> 
> >* Thus wrote zavaboy ([EMAIL PROTECTED]):
> >  
> >
> >>I have the following numbers:
> >>
> >>12.400
> >>666.75
> >>23
> >>369.2
> >>3.234
> >>
> >>How can I make them have at least 2 decimal places?
> >>So, they will output:
> >>
> >>12.40
> >>666.75
> >>23.00
> >>269.20
> >>3.234
> >>
> >>Thanks in advance!
> >>
> 
> What I dont understand is that your examples are not consitant.  You 
> want 2 or more decimal positions, so as if there are more than 2, to 
> leave what exists.  But your first example, you truncate the 
> last 0.  Is 
> that a typo, or intentional?

What's so hard about this?

He wants two or more *significant* positions preserved.  Show to at least
two decimal places, trailing zeroes truncated beyond the 2nd decimal place.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to