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 Link to comment https://forums.phpfreaks.com/topic/60974-solved-help/ Share on other sites More sharing options...
chigley Posted July 20, 2007 Share Posted July 20, 2007 <?php echo number_format(76474899659488565689 * 245645645564564); ?> Link to comment https://forums.phpfreaks.com/topic/60974-solved-help/#findComment-303402 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 Link to comment https://forums.phpfreaks.com/topic/60974-solved-help/#findComment-303405 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. Link to comment https://forums.phpfreaks.com/topic/60974-solved-help/#findComment-303408 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? Link to comment https://forums.phpfreaks.com/topic/60974-solved-help/#findComment-303410 Share on other sites More sharing options...
pedrobcabral Posted July 20, 2007 Share Posted July 20, 2007 Roll your eyes one post above yours. Link to comment https://forums.phpfreaks.com/topic/60974-solved-help/#findComment-303411 Share on other sites More sharing options...
H Posted July 20, 2007 Author Share Posted July 20, 2007 Yes just noticed, thanks again Link to comment https://forums.phpfreaks.com/topic/60974-solved-help/#findComment-303412 Share on other sites More sharing options...
chigley Posted July 20, 2007 Share Posted July 20, 2007 echo number_format(76474899659488565689 * 245645645564564, 0, ".", ""); Link to comment https://forums.phpfreaks.com/topic/60974-solved-help/#findComment-303413 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.