Re: Why doesn't working with array's ever stick in my thick head?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux