php_novice2007 Posted August 28, 2007 Share Posted August 28, 2007 Hi, Can I display a php number to only 1 decimal place? How? E.g. 43.564243 I want to display just 43.6 Thanks! Link to comment https://forums.phpfreaks.com/topic/67035-displaying-function/ Share on other sites More sharing options...
hostfreak Posted August 28, 2007 Share Posted August 28, 2007 Look into <a href="http://www.php.net/round">PHP: Round</a> Link to comment https://forums.phpfreaks.com/topic/67035-displaying-function/#findComment-336169 Share on other sites More sharing options...
piznac Posted August 28, 2007 Share Posted August 28, 2007 Try this: <?php $num = 43.564243; $rounded = round($num,2); echo $rounded; ?> Link to comment https://forums.phpfreaks.com/topic/67035-displaying-function/#findComment-336176 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.