Thanks:!:
PHP + Math Logic [Easy]
Moderator: General Moderators
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
PHP + Math Logic [Easy]
My brain is dead right now
... How can I figure out how many pounds and ounces are in x knowing 1 pound = 16 ounces. I want php to convert say 234 ounces to whatever pounds and y ounces.
Thanks:!:
Thanks:!:
Code: Select all
$pounds = floor($ounces / 16);
$ounces = $ounces - ($pounds * 16);- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Thanks! Worked.astions wrote:I'm tired too, but that should work.Code: Select all
$pounds = floor($ounces / 16); $ounces = $ounces - ($pounds * 16);
Now I'm off to bed.