Welcome to WebmasterWorld Guest from 54.159.50.111

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

php number format is not giving expected output after odbc connect

php number_format not working correctly

     
5:35 am on Apr 25, 2012 (gmt 0)

New User

joined:Oct 21, 2011
posts: 2
votes: 0


Please check the output of the code bellow.

<?php
define("DSN","somedb");
define("USER","");
define("PASS","");

echo number_format(17, 2, '.', ',');
echo number_format(19, 2, '.', ',');

$dbObj = odbc_connect(DSN,USER,PASS);

echo number_format(17, 2, '.', ',');
echo number_format(19, 2, '.', ',');
?>


now after odbc_connect for the code bellow:

echo number_format(17, 2, '.', ',');

expected output is

17.00
but it's giving output

16.:0

and same thing happening for 19 too. for all the other numbers output is as expected.

i am using windows server 2008 , apache 2.2, php 5.2.17

i have found this

[bugs.php.net...]

but this doesn't give a solution

can anyone tell me what is the problem. i am sure some of you have faced this problem. so please let me know what this is and how to solve/overcome it.
8:23 am on Apr 25, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Apr 30, 2007
posts:1394
votes: 0


Looks like an odbc driver problem not php.
12:22 pm on Apr 30, 2012 (gmt 0)

New User

joined:Oct 21, 2011
posts: 2
votes: 0


I have got the solution. I installed php5.3.11 and problem solved.