BRADERY Posted January 13, 2011 Share Posted January 13, 2011 a number variable I had set was $variable = 100000219710948; I figured you could put any sized number as a variable without putting it in quotations I had it echo out without quotations and it turned out as 1.0000021971095E+14 It changes the number completely, any reason why it does this? Link to comment https://forums.phpfreaks.com/topic/224275-wtf/ Share on other sites More sharing options...
Pikachu2000 Posted January 13, 2011 Share Posted January 13, 2011 It's the same number in it's exponent form. Link to comment https://forums.phpfreaks.com/topic/224275-wtf/#findComment-1158746 Share on other sites More sharing options...
BRADERY Posted January 13, 2011 Author Share Posted January 13, 2011 Only way to avoid that is putting it in quotations correct? I love the video in your sig too, thats like my newbie ass haha Link to comment https://forums.phpfreaks.com/topic/224275-wtf/#findComment-1158751 Share on other sites More sharing options...
Pikachu2000 Posted January 13, 2011 Share Posted January 13, 2011 You can put it in quotes so it's handled as a string, or you can use number_format, using empty strings for the decimal and thousands separators, or you can change a directive in php.ini to set the max length if you want to. ; The number of significant digits displayed in floating point numbers. precision = 12 Link to comment https://forums.phpfreaks.com/topic/224275-wtf/#findComment-1158758 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.