|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-10 09:37 UTC] mfischer@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 08:00:01 2025 UTC |
We create a table with a field in type of numeric(18,2) In case of isql, I get the correct result, but in case of PHP, the result is strange create table test ( Id varchar(32) not null, AA numeric(18,2) not null, constraint PK_ID primary key (Id) ) go INSERT INTO test (Id, AA) VALUES ('0001', 80) INSERT INTO test (Id, AA) VALUES ('0002', 80.00) INSERT INTO test (Id, AA) VALUES ('0003', 80.01) INSERT INTO test (Id, AA) VALUES ('0004', 80.5) INSERT INTO test (Id, AA) VALUES ('0005', 80.50) INSERT INTO test (Id, AA) VALUES ('0006', 80.51) INSERT INTO test (Id, AA) VALUES ('0007', 1111111111111111.55) INSERT INTO test (Id, AA) VALUES ('0008', 1111111111111111.50) go My test script is: <?php @$results = sybase_query("select * from test"); while ($row = sybase_fetch_array($results)){ echo "$row[0] ||$row[1] <br>"; } ?> But I get the following results: 0001 ||80.0 0002 ||80.0 0003 ||80.010000000000005 0004 ||80.5 0005 ||80.5 0006 ||80.510000000000005 0007 ||1111111111111111.5 0008 ||1111111111111111.5