|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2000-06-01 18:21 UTC] jakub dot soucek at spika dot cz
Function ceil() returns the same value as floor(), i.e. ceil(9.7) = floor(9.7) = 9. In PHP 3 this code works fine. When I try to replace decimal point with comma, I get error message (this seems to be correct). I use Czech WinNT Workstation 4.0 with point as a decimal separator in regional settings, IIS 4.0 with PHP ISAPI module. I also tried to change the regional number settings so I don't think it is a problem of decimal separator. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 19:00:02 2025 UTC |
now call me stupid ... what i was trying to say this time was: could you pleas try ceil("9,7") or see what the result of 9.7 - 9 is compared to 9,7 - 9You were right - ceil("9,2") gives me correct result (10), ceil("9.2") gives me 9. So when I use string parameter and choose correct decimal separator it works just fine. But it seems to me I cannot use float constant assignment. Let's have this: $f = $j * $i; and assign $i and $j to $i = 2.4 2,4 "2.4" "2,4" $j = 5.3 5,3 "5.3" "5,3" ceil($f) 10 ERR 10 13 floor($f) 10 ERR 10 12 It probably is problem with the locale, but I must admit I am a bit confused. Or am I missing something obvious?