H Posted July 20, 2007 Share Posted July 20, 2007 hello, i have a problem with multiplying big numbers in php eg. <?php echo 76474899659488565689*245645645564564; ?> gives an output of '1.87857260963E+34' Is there a way I can make php show the full number? Regards, Harvey Quote Link to comment Share on other sites More sharing options...
chigley Posted July 20, 2007 Share Posted July 20, 2007 <?php echo number_format(76474899659488565689 * 245645645564564); ?> Quote Link to comment Share on other sites More sharing options...
H Posted July 20, 2007 Author Share Posted July 20, 2007 Thank you so much for the quick reply, worked a treat, cheers Quote Link to comment Share on other sites More sharing options...
pedrobcabral Posted July 20, 2007 Share Posted July 20, 2007 <?php echo bcmul("76474899659488565689", "245645645564564"); ?> Also have this way. Quote Link to comment Share on other sites More sharing options...
H Posted July 20, 2007 Author Share Posted July 20, 2007 This is not compulsary to me but is there a way of getting rid of the commas (,) from the output number? Quote Link to comment Share on other sites More sharing options...
pedrobcabral Posted July 20, 2007 Share Posted July 20, 2007 Roll your eyes one post above yours. Quote Link to comment Share on other sites More sharing options...
H Posted July 20, 2007 Author Share Posted July 20, 2007 Yes just noticed, thanks again Quote Link to comment Share on other sites More sharing options...
chigley Posted July 20, 2007 Share Posted July 20, 2007 echo number_format(76474899659488565689 * 245645645564564, 0, ".", ""); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.