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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 10:01:28 2024 UTC