|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-01-16 15:13 UTC] pjotrik at post dot cz
Description: ------------ When I try to round a number like X.YZ5 with precision 2, I get X.YZ, but Z number should be incremented to Z+1 Reproduce code: --------------- $a=round(2.225,2); Expected result: ---------------- $a=2.23 Actual result: -------------- $a=2.22 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 19:00:02 2025 UTC |
Sorry, I have a better example: echo (4.3*((100-25)/100)); ----> result: 3.225 echo round(4.3*((100-25)/100),2); ----> result: 3.22 echo round(3.225,2); ----> result: 3.23