Re: [PHP] Why doesn't working with array's ever stick in my thick head?
- Date: Fri, 09 May 2008 16:20:03 -0400
- From: Roberto Mansfield <robertom@xxxxxxxxxxxxx>
- Subject: Re: [PHP] Why doesn't working with array's ever stick in my thick head?
Jason Pruim wrote:
>> Why do you want tenth's of pounds? Just divide pounds by 16 and you'll
>> get ounces.
>
> It's actually for a weight calculator that we use for some of our
> mailings. when you take .226 and multiply that by 464 you get 104.864
> ounces.
>
> I need to be able to display that as: 6 # 13.824 Ounces.
Then I think you want to use the mod operator:
(I'm assuming .226 is the cost per ounce and 464 is the total number of
ounces)
$pounds = intval( .226 * 464 / 16 );
$ounces = ( .226 * 464 ) % 16;
Roberto
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php