Thread: coding question
View Single Post
Old 01-17-2014, 05:13 PM  
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,055
Quote:
Originally Posted by sarettah View Post
Same as we did the select, just divide height by 12 (12 inches in a foot) and then get the remainder for the left over inches:

intval($height/12) . ' feet ' . ($height-(intval($height/12)*12)) . ' inches';
Actually that should be:

<?=intval($detail['height']/12) . ' feet ' . ($detail['height']-(intval($detail['height']/12)*12)) . ' inches';?>

Where you have:

<?=$detail['height'];?>

Hate when I screw up
sarettah is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook