Re: =.='' what wrong ? just simple code, however error.
| From: | Micah Gersten | Date: | Wed, 31 Dec 2008 16:25:08 +0000 |
| Subject: | Re: =.='' what wrong ? just simple code, however error. | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-285292@lists.php.net to get a copy of this message | ||
http://us3.php.net/manual/en/function.number-format.php
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
LKSunny wrote:
> i need accuracy, how to ?
>
> Thank You.
>
> "Per Jessen" <per@computer.org>
> ¼¶¼g©ó¶l¥ó·s»D:gjg4fk$58p$1@saturn.local.net...
> LKSunny wrote:
>
>
>> <?
>> $credithold = 100;
>> for($i=1;$i<=1000;$i++){
>> $credithold -= 0.1;
>> echo "$credithold<br />";
>> }
>> //i don't know why, when run this code, on 91.3 after expect is 91.2,
>> however......91.200000000001
>> //who can help me ? and tell me why ?
>>
>
> It's a floating point rounding error. If you don't need the accuracy,
> just round it to what you need.
>
>
> /Per Jessen, Zurich
>
>
>
>