NYCPHP Meetup

NYPHP.org

[nycphp-talk] number_format / round issue

Donald J Organ IV dorgan at optonline.net
Wed Nov 8 12:44:19 EST 2006


I have data that I am pulling out of the database a number such as 3.987 
and number_format() seems to work fine when i tell it I only want two 
decimal places but I am having a problem with 4.075 when applying 
number_format() I should be getting 4.08 and i am not.

This is running on PHP 4.4.4 on IIS

If i run the same code on a Linux PHP 5.2 box the correct number is 
returned, what is extremely strange is that both numbers being formated 
are in the same for loop, therefore the same operations are being 
performed on both pieces of data.


Unfortunately switching the entire system over the the linux box cannot 
be the solution(as of right now, it is planned for the future).

Just wondering if anyone else has run into this situation.



More information about the talk mailing list