kigroy Posted December 18, 2008 Share Posted December 18, 2008 how do i limit the number of decimal places displayed when performing math functions in php? Link to comment https://forums.phpfreaks.com/topic/137483-limit-float-number-for-result-for-equation/ Share on other sites More sharing options...
xtopolis Posted December 18, 2008 Share Posted December 18, 2008 sprintf I believe. Plenty of examples if you scroll down. Link to comment https://forums.phpfreaks.com/topic/137483-limit-float-number-for-result-for-equation/#findComment-718492 Share on other sites More sharing options...
mmarif4u Posted December 18, 2008 Share Posted December 18, 2008 yup, sprintf() will work. You also can use round, if you want. Link to comment https://forums.phpfreaks.com/topic/137483-limit-float-number-for-result-for-equation/#findComment-718494 Share on other sites More sharing options...
kigroy Posted December 18, 2008 Author Share Posted December 18, 2008 Thanks! Worked great! Link to comment https://forums.phpfreaks.com/topic/137483-limit-float-number-for-result-for-equation/#findComment-718509 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.