Emanuele,
Some parts of the world use the coma as the separator between whole numbers
and decimals (e.g. Germany & France) and php is formating the number
according to this style.  I surmise that the numbers stored in your database
have been stored with comas separating the thousands from the hundreds
(English & US style), so you'll need to grab the number, eliminate the coma
(something like $num=ereg_replace(",","",$num) will do this but there is
likely a more direct php command for this), then when you want to display
the number use number_format($num,2,".",",").
Hope this helps.
Hugh
----- Original Message -----
From: "Emanuele" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 23, 2003 5:09 AM
Subject: [PHP] numbers problem


> Hi, I'm using a mysql connection to dinamically fill a table with
> descriptions, prices, and so on...
>
> But when the script takes the price of a Plasma Monitor, that costs
8025.00
> $, it outputs only 8,00.
> I recall it by typing :
>
> echo $row_Recordset1['Prezzo']
>
> And please note that I've seen that it happens only when
> $row_Recordset1['Prezzo'] > 1000
>
> Can anyone tell me why and what can I do ?
> Please answer me, it's very important...
> Thanks
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

Reply via email to