php adding e+14 to argument

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mlecho
Forum Commoner
Posts: 53
Joined: Wed Feb 02, 2005 9:59 am

php adding e+14 to argument

Post by mlecho »

hi all...i have to pass a big number like 131230510244007 to a method, but in the method it is being read like 1.31230510244E+14. It's really a straight forward thing, but i am not sure why php sees the number as such. What can i do to straighten this up?

here is the gist:

Code: Select all

public function getPhotos($album)
	{     
		$data= $this->_query(GETPHOTOS,array("album"=>131230510244007)); 
		return $data;
	}
public function _query($q,$args=null)
{
    $album = $args['album'];
    echo $album;
    return $this->doSomethingWithAlbum($album);
}
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: php adding e+14 to argument

Post by requinix »

Most regular computers can't handle numbers that large. You just can't.

Pass it as a string, and if you need to do calculations on it use something like bcmath.
Post Reply