01-28-2008, 08:32 PM
|
#10 (permalink)
|
|
The Frequenter
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
|
intval doesn't round anything. it just returns the integer part of the number. number_format rounds the number automatically (depending on the decimal precision).
PHP Code:
echo intval(13.397); // 13 echo intval(15.99); // 15
echo number_format(15.56, 0, '', ''); // 16 echo number_format(12.21, 0, '', ''); // 12
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
|
|
|
|