View Single Post

  #2 (permalink)  
Old 07-21-2003
John Nichel
 
Posts: n/a
Default Re: [PHP] Changing numbers

zavaboy wrote:
> *Sigh*, lets say I have:
>
> 2.65
> 3.3
> 5.2670
> 12.030
>
> I would like it at least 2 decimal places.. So, 5.2670 would be 5.267 not
> 5.27:
>
> 2.65
> 3.30
> 5.267
> 12.03
>
> "James Rodenkirch" <jamesr@ez-net.com> wrote in message
> news:3F1C298E.80602@ez-net.com...
>
>>try rounding it first
>>
>>http://www.php.net/manual/en/function.round.php
>>
>>Zavaboy wrote:
>>
>>
>>>What about if I had 2.856 that function will make it 2.86.
>>>
>>>
>>>"Jay Blanchard" <jay.blanchard@niicommunications.com> wrote in message
>>>news:C8F323573C030A448F3E5A2B6FE2070B0101F95A@n emesis...
>>>[snip]
>>>How can I make them have at least 2 decimal places?
>>>[/snip]
>>>
>>>RTFM at http://www.php.net/number_format
>>>
>>>HTH!
>>>
>>>

>>

>


*Sigh*

RTFM - http://us4.php.net/sprintf

Reply With Quote