Jump to content

(if $var <= 0) When $var is a float


Hobbyist_PHPer

Recommended Posts

Hi, can someone please help me with this seemingly trivial issue that I'm having... On my view & edit forms, I don't want to show float values that are <= 0 ... but no matter how I seem to write it, it won't work... I've tried the following

 

<? if($row['ServicesPricePerMinute'] <= floatval(0.00)){echo '';} else {echo $row['ServicesPricePerMinute'];} ?>
<? if($row['ServicesPricePerMinute'] <= 0){echo '';} else {echo $row['ServicesPricePerMinute'];} ?>

 

Can someone please help me out?

Link to comment
https://forums.phpfreaks.com/topic/263270-if-var/
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.