ID: 16511
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Bogus
Bug Type: Variables related
Operating System: linux 2.2.12, apache 1.3.23
PHP Version: 4.1.2
New Comment:
the really amusing thing is that THIS IS RIGHT.
if you want it to give you a rounded figure, this code will help you:
<?php
printf("%0.2f", 18/21);
?>
Previous Comments:
------------------------------------------------------------------------
[2002-04-09 08:08:10] [EMAIL PROTECTED]
erm
18/21 = 0.857142857142861.
If you just want 0.86, use number_format() or round()
not a bug,
Bogus
------------------------------------------------------------------------
[2002-04-09 08:03:23] [EMAIL PROTECTED]
echo (18/21);
returns 0.857142857142861.
right is 0.86;
my configure command:
'./configure' '--prefix=/usr' '--with-config-file-path=/etc'
'--disable-debug' '--enable-pic' '--enable-inline-optimization'
'--with-apxs=/usr/sbin/apxs' '--disable-static' '--enable-shared'
'--with-exec-dir=/usr/bin' '--with-regex=system' '--with-gettext'
'--with-gd' '--with-openssl'' -with-jpeg-dir=/usr' '--with-png'
'--with-zlib' '--with-gdbm' '--with-kerberos' '--with-imap-ssl'
'--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode'
'--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars'
'--enable-gd-imgstrttf' '--enable-yp' '--enable-ftp' '--without-mysql'
'--with-xml' '--with-ttf' '--with-gnu-ld' '--with-mysql=shared,/usr'
'--with-pgsql=shared,/usr' '--with-imap=shared,/usr'
'--with-ldap=shared'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16511&edit=1