note 11693 added to Mathematical Functions
| From: | dalexis at dalexis dot net | Date: | Fri, 02 Mar 2001 16:02:42 +0000 |
| Subject: | note 11693 added to Mathematical Functions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11781@lists.php.net to get a copy of this message | ||
Here is a pretty easy way to convert someone's weight in pounds to the English stones and
pounds:
$WeightStones = floor($weight/14);
$WeightPounds = ($weight%14);
echo $WeightStones."st ".$WeightPounds."lbs (".$weight."lbs)";
If the person weighs 136lbs, "9st 10lbs" will be returned.
Hope this helps someone...
http://www.php.net/manual/en/ref.math.php