note 49351 deleted from function.floor by danbrown

From: Date: Thu, 10 Mar 2011 15:22:14 +0000
Subject: note 49351 deleted from function.floor by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-177763@lists.php.net to get a copy of this message
Note Submitter: peter at harbour-design dot co dot uk ---- If you are after just removing the decimal places and returning an integer, try: <? $iPosDecimalNo = 5.67; $iNegDecimalNo = -5.67; print (int)$iPosDecimalNo; print (int)$iNegDecimalNo; ?> result will: 5 -5 No rounding up or down, just truncation and works for positive and negative numbers.

« previous php.notes (#177763) next »