You could use number_format..
$f = 25.50 * 3
$s = number_format($f,2,'.',NULL);
Lang
Richard Cook wrote:
> I have a problem with the following
>
> when i multiply for example 25 . 50 * 3 i get 76 . 5 how would i get PHP
> to recognise the last 0 ie make it 76 . 50
>
> Any ideas?
>
>
> Reg
$price = 25;
$f_price = sprintf("%01.2f","$price");
echo "$f_price";
This will give you 25.00 instead of 25. Maybe put your result into a
variable and then convert it into the decimal number using the sprintf()
function.
Dimitri Marshall
"Richard Cook" <[EMAIL PROTECTED]> wrote in message
news:[
2 matches
Mail list logo