LMPX.COM |
Home | Linux | Mysql | PHP | XML | ||
|
|
|||
From: Jason Pruim Date: Fri May 9 11:29:20 2008 Subject: Re: Why doesn't working with array's ever stick in my thick head?
Hey tedd On May 9, 2008, at 1:21 PM, tedd wrote: > At 12:56 PM -0400 5/9/08, Jason Pruim wrote: >> Hi Everyone, >> >> SO it's friday, I'm tired, and I can't seem to think straight... I >> am attempting to do some very basic math with some arrays... Here's >> the pseudo code that I'm working with: >> >> NumberOfPieces * PieceWeight = TotalWeight >> >> explode total weight to get tenth's of pounds, then divide tenth's >> of pounds by 16 to grab ounces. > > What?? > > 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. > > > --- > >> Display TotalWeight # Exploded Ounces. >> >> Which I have working just fine for a single set of boxes... >> >> My problem is I want to be able to automatically add say 50 boxes >> in a form to process the weight of each route... > > How much does each box weight and how many boxes? That's all you need. the routes can have anywhere from 1 piece to 800+ pieces. and we can have as few as 1 route to as many as 50 or 60+ > > > --- > >> So what I need to do is probably use some kind of a counter to loop >> through my $RoutePieces array and multiply by the $PieceWeight? >> $PieceWeight is a static number. > > Is $PieceWeight is a static number? > > The last time I checked, the cost per oz for shipping depends upon > the weight. The more weight, the less the cost per ounce. Is that > not true? Normally yes, but not in this case :) I'm using it so I don't have to sit there and count out 464 postcards. I can just throw them on my scale and get the total weight. > > > --- > > As for the code, that's pretty simple. Then it's a simple "It's a friday thing" for me... My wife keeps rubbing in that today is her last day of work until mid august... :P -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com japruim@raoset.com
| Navigate in group php.general at sever news.php.net | |
| Previous | Next |
| © No Copyright You are free to use Anything |
Site Maintained by PHP Developer
Powered By PHP Consultants |