Welcome to WebmasterWorld Guest from 54.144.231.243

Forum Moderators: coopster & jatar k

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)



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)

WebmasterWorld Senior Member 5+ Year Member



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



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

Featured Threads

Hot Threads This Week

Hot Threads This Month