Just so I never foget… observe the following test cases -

$foo = 8.37*40*0.175*100; echo $foo.' == '.(int)$foo;
> 5859 == 5858

$foo = 8.37*40*0.175*100; echo $foo.' == '.round($foo);
> 5859 == 5859

I believe that casing to INT will round towards zero as documented in the php docs, I also believe the 5858 number above is because the floating point number is always fractional…

another interesting one -

$foo = 8.37*40*0.175*100; echo $foo.' == '.(int)(string)$foo;
> 5859 == 5859

By casting to string first the floating point element is removed….


September 2010
S M T W T F S
 1234
567891011
12131415161718
19202122232425
2627282930  
August 2010
S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031  
July 2010
S M T W T F S
 123
45678910
11121314151617
18192021222324
25262728293031
June 2010
S M T W T F S
 12345
6789101112
13141516171819
20212223242526
27282930  
powered by
wordpress
theme and icons by
web-engineer

©2008 web-engineer™
all rights reserved