#23316 [Fbk->Opn]: Loss of precision in float data when SQL Server is queried

From: Date: Thu, 01 May 2003 00:39:30 +0000
Subject: #23316 [Fbk->Opn]: Loss of precision in float data when SQL Server is queried
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38872@lists.php.net to get a copy of this message
 ID:               23316
 User updated by:  hammer88 at hotmail dot com
 Reported By:      hammer88 at hotmail dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         MSSQL related
 Operating System: Windows 2000
 PHP Version:      4.3.2-RC
 New Comment:

I did not try modifying the locale format.  My solution was just
modifying the data type in SQL Server so it was a decimal instead of
money.  All is well.


Previous Comments:
------------------------------------------------------------------------

[2003-04-30 06:14:45] sniper@php.net

Did changing the currency settings affect this or not?


------------------------------------------------------------------------

[2003-04-24 03:26:49] sniper@php.net

try it?


------------------------------------------------------------------------

[2003-04-23 16:20:30] hammer88 at hotmail dot com

Replaced the php.exe & php4ts.dll files and verified the new version
with phpinfo().  But problem still persisted.  Is this because php
utilizes the local computer's currency settings?  Which I assume
default for Windows is two decimal places?  That wouldn't be cool to
have to change that default just for this instance... ideas?

------------------------------------------------------------------------

[2003-04-23 11:02:01] sniper@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip



------------------------------------------------------------------------

[2003-04-23 10:06:11] hammer88 at hotmail dot com

I created a query and tested in SQL Server Query Analyzer.  The query
returns a number that is stored as 1.0947 as data type money to 8
digits. But when I run this query from PHP 

$dbTradeRow=mssql_fetch_object($trades_result) 

to retrieve the data and check that column, it returns only 1.09 and i
loose the last two digits. Can somebody please help me out?

------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=23316&edit=1



Thread (8 messages)

« previous php.bugs (#38872) next »