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!
I know that's how php represents long numbers but I want my output to say 10000000000000000000000000000 not 1E+028.
I'm wondering if there is a built in function or a way that will automatically convert (scientific float) -> (normal string) or if I have to write one myself.
PHP does not process large integers natively. They are automatically converted to floating point after you reach a certain threshold. What that is, depends on the build you run it on. Use GMP or BC instead.
mu-ziq wrote:
I'm wondering if there is a built in function or a way that will automatically convert (scientific float) -> (normal string) or if I have to write one myself.
$n = '10000000000000000000000000000';
If the database stores them as integers maybe you could use mysql to cast them so they come back as strings or something?
I don't think it has to be as complicated as a function but I've never had to deal with this sort of thing so I could be wrong.