View Single Post
Old 01-28-2008, 06:21 PM   #2 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

When converting from a float to an int, PHP just strips the decimal point and everything after it. For example:

PHP Code:
<?php

echo (int) 4856756.55;

// echo's 4856756
Take a look at my article on Variables for more info: TalkPHP - Variables for Beginners

For more precise numbers, you'll need to use the BCMath extension in PHP: PHP: BC math - Manual

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
The Following User Says Thank You to Alan @ CIT For This Useful Post:
Haris (01-28-2008)