Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Instead of 0.1, how to show as 0.01?

$
0
0

Hello,

 

I need to shwo $percent if it is below 0.10 to be 0.01 for example.

 

	case $timenow < $todayInfo['sunrise']: // is it pre-sunrise
			 // get last night's sunset
			 $nighttime = true;
			 $yesterdayInfo = date_sun_info(strtotime('-1 days', $today), $lat, $long);
			 $percent = round(($timenow - $yesterdayInfo['sunset'] )*100/($todayInfo['sunrise'] - $yesterdayInfo['sunset']));
			 break;

 

Thank you fro any help and/or advice in advanced,.

 

Best Regards,

Tim


Viewing all articles
Browse latest Browse all 13200

Trending Articles