Jump to content

Instead of 0.1, how to show as 0.01?


MrTIMarshall

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/275782-instead-of-01-how-to-show-as-001/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.