This is not what I want.
I want only remove the right zeros, that is:
$a = 2.1;
number_format($a, 2, ",", "."); // 2,10
I want to display 2,1

$a = 2.00;
number_format($a, 2, ",", "."); // 2,00
I want to display 2

$a = 2.46;
number_format($a, 2, ",", "."); // 2,46
this is ok I want to display 2,46


Ben Cairns wrote:

> Say, you get the result into a variable called $foo
> You could use:
> floor($foo);
> this would round it DOWN to a whole number:
> EG
> 2.1 returns 2
> 2.9 returns 2
>
> -- Ben Cairns - Head Of Technical Operations
> intasept.COM
> Tel: 01332 365333
> Fax: 01332 346010
> E-Mail: [EMAIL PROTECTED]
> Web: http://www.intasept.com
>
> "MAKING sense of
> the INFORMATION
> TECHNOLOGY age
> @ WORK......"
>
> --
> PHP Database 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]

--

==================================================================
Valerio Ferrucci                        Tabasoft Sas
[EMAIL PROTECTED]                      http://tabasoft.ancitel.it
                                        [EMAIL PROTECTED]



-- 
PHP Database 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