php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36356 After form submit system changing value other then entered
Submitted: 2006-02-10 16:34 UTC Modified: 2006-02-10 16:40 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: Vlad at valuead dot com Assigned:
Status: Not a bug Package: *Math Functions
PHP Version: 4.4.2 OS: Gentoo
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Vlad at valuead dot com
New email:
PHP Version: OS:

 

 [2006-02-10 16:34 UTC] Vlad at valuead dot com
Description:
------------
Form submitting a dollar value $2.30 saved in MYSQL as $2.29, any other value is fine like 2.40
4 people looked it it - nothing out of ordinary

Reproduce code:
---------------
http://www.valuead.com/utils/bug.txt

For whatever reason intval(230.0) returns 229


field CPM Cost http://www.valuead.com/utils/bug.txt
if nessesary would be happy to provide access to demo system

Expected result:
----------------
system should of store 2.30 in the database insted of 2.29

Actual result:
--------------
$2.99 in database after form submission insted of 2.30

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-10 16:39 UTC] tony2001@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 [2006-02-10 16:40 UTC] derick@php.net
Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.

If you would like to know more about "floats" and what IEEE
754 is read this:
http://docs.sun.com/source/806-3568/ncg_goldberg.html
 
Thank you for your interest in PHP.

.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 28 04:01:23 2020 UTC