> I'm finding some problems on using number_format($value, $decimal, ",",
> ".") when I have a value comming from a resultset (database query
> results)...
> If I had something like '123.45', using number_format it will return
> '123,00'.
> I think this happens because my value is a string and PHP rounds it
> before using it on number_format. If I try to change the data type like
> (double) $value, I will also have a '123.00' result.
> I could do something on database like 'to_char(FIELD, '999G999D99') but
> database default is '.' for decimal separator and ',' for thousand
> separator...and I want the opposite.
> Suggestions/Solutions? :)

Your database may have a number_format() function that can better interact
with the internal data of the database.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



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