Fruct0se Posted October 27, 2008 Share Posted October 27, 2008 I am having a problem with integers. $bignum = 12000000; when called it outputs 1.2E+7 How can I get it to output in it's original format? Link to comment https://forums.phpfreaks.com/topic/130228-solved-long-integer-headache/ Share on other sites More sharing options...
Alt_F4 Posted October 27, 2008 Share Posted October 27, 2008 can you give some more info: where is it called from, by what, where is it outputing to, etc? Link to comment https://forums.phpfreaks.com/topic/130228-solved-long-integer-headache/#findComment-675411 Share on other sites More sharing options...
Fruct0se Posted October 27, 2008 Author Share Posted October 27, 2008 $dailybudget = $dailybudget * 1000000; $campaign = '<campaign>' . '<name>'.time().'</name>' . '<budgetPeriod>Daily</budgetPeriod>' . '<budgetAmount>'.$dailybudget.'</budgetAmount>' . '<geoTargeting>' . '<countryTargets><countries>US</countries></countryTargets>' . '</geoTargeting><status>'.$status.'</status>' . '<languageTargeting><languages>en</languages></languageTargeting>' . '</campaign>'; I am using SOAP to send the headers but even when using echo it outputs as 1.2E+7 this is when $dailybudget is set to 12, it can change based on user input Link to comment https://forums.phpfreaks.com/topic/130228-solved-long-integer-headache/#findComment-675416 Share on other sites More sharing options...
Jeremysr Posted October 27, 2008 Share Posted October 27, 2008 Use number_format(): $bignum = 12000000; echo number_format($bignum, 0, '', ''); // echos 12000000 Link to comment https://forums.phpfreaks.com/topic/130228-solved-long-integer-headache/#findComment-675417 Share on other sites More sharing options...
Fruct0se Posted October 27, 2008 Author Share Posted October 27, 2008 Perfect! Thanks Link to comment https://forums.phpfreaks.com/topic/130228-solved-long-integer-headache/#findComment-675419 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.