homepage Welcome to WebmasterWorld Guest from 54.205.247.203
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
php number format is not giving expected output after odbc connect
php number_format not working correctly
kmsadrulula




msg:4445009
 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

https://bugs.php.net/bug.php?id=47418&edit=1

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.

 

enigma1




msg:4445065
 8:23 am on Apr 25, 2012 (gmt 0)

Looks like an odbc driver problem not php.

kmsadrulula




msg:4447461
 12:22 pm on Apr 30, 2012 (gmt 0)

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved