| | Usually when you output a large number (>14 digits), it takes it and turns it into an exponential expression (eg: 1.6E+15). Is there a way to change it so that it doesn't turn it into that and just keeps outputting all the digits? |
|
|
The first two options that spring to mind would be assigning the value to a string variable type, or using the number_format() function (which returns the value as a string, and also groups the digits in blocks of three seperated by a comma, by default).
For example: CODE // If printed, would display '1.e+14' $number = 100000000000000; // If printed, would display the value as a string, exactly as you see it // (the quotes indicate a string value) $number = '100000000000000'; // If printed, would display the number with digit grouping $number = number_format(1.e+14); Hope that explains things for you.
Number format is good, I just used number_format($n,0,'','') the separator '', which achieved the desired affect.
Similar Topics
Keywords : outputting numbers
I am making a MySQL-driven list. It can be ordered by name or by a number in the table. However, it Looking for outputting, large, numbers
|
|
![]() Outputting Large Numbers |
| ADD REPLY / Got an Opinion! | Remove these ADs! | RAPID SEARCH! | Free Web Hosting | [X] |
|
Express your Opinions, Thoughts or Contribute more info. to help others. Ask your Doubts & Queries to get answers, So that "Together We can help others!" |
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP. | 500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE |
|