php-general | 2001092
Date: 09/28/01
- Next message: Maxim Maletsky \(PHPBeginner.com\): "RE: [PHP] Fw: Print float with varying format???"
- Previous message: Tom Churm: "[PHP] MySQL - Selecting Unique Entries"
- In reply to: Keith: "[PHP] Fw: Print float with varying format???"
- Next in thread: Maxim Maletsky \(PHPBeginner.com\): "RE: [PHP] Fw: Print float with varying format???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
At 28.09.2001 13:27, somebody-w-o-realname wrote:
>Hello,
>
>I would like to display a float to a precision of 2 but not if the
>trailing values are 0.
>
>Ex:
> 1.0000 should display '1'
> 1.5000 should display '1.5'
> 1.2500 should display '1.25'
> 1.6667 should display '1.67'
>
> Is their any display functions that would allow this?
>I know that I can display fixed precision of 2 but I don't want the trailing
>numbers!
check out the round() function and the other maths functions...
--
Andreas D Landmark / noXtension
Real Time, adj.:
Here and now, as opposed to fake time, which only occurs there
and then.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Maxim Maletsky \(PHPBeginner.com\): "RE: [PHP] Fw: Print float with varying format???"
- Previous message: Tom Churm: "[PHP] MySQL - Selecting Unique Entries"
- In reply to: Keith: "[PHP] Fw: Print float with varying format???"
- Next in thread: Maxim Maletsky \(PHPBeginner.com\): "RE: [PHP] Fw: Print float with varying format???"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

