Page 1 of 1

mySQL number erro.

Posted: Wed Aug 24, 2005 11:32 am
by someberry
I have a small script that adds a certain amount to a number already in a database. It works fine, until it gets to large numbers, such as 100000000000, where is changes to something like: 1.0000000000e+22.

I am using a `text`column for this, it has to be a `text`, it can't be `int` or other numeric fields.

Does anyone know of any ways around this so it displays the correct number without the e+22 etc?

Thanks,
Someberry.

Posted: Wed Aug 24, 2005 12:13 pm
by feyd
research large integer libraries. That value goes outside the range of a "standard" integer (32 bits)

Posted: Wed Aug 24, 2005 1:47 pm
by someberry
I looked on Google, but couldnt find anything to help me. Is there anyway to make them 64bit, 128bit etc whithout having to add any modules to PHP/mySQL?

Posted: Wed Aug 24, 2005 3:04 pm
by feyd
you don't necessarily have to install any modules, you just need a library that can perform all the tasks you want on much larger integer sets.


http://php.net/gmp