Administrators Nabeel Posted December 7, 2009 Administrators Report Posted December 7, 2009 For conversions... I suck at these... // Convert units from gallons to lbs if(self::$unit == 'lbs') { $result->jeta = $result->jeta / 6.4; // 6.4 pounds per gallon $result->lowlead = $result->lowlead / 6.4; } elseif(self::$unit == 'kg' || self::$unit == 'kgs') { $result->jeta = ($result->jeta / 6.4) * .45359; $result->lowlead = ($result->lowlead / 6.4) * .45359; } Basically I start with the fuel price, per gallon. Then to convert to price per lb, divide by 6.4. To KG, I convert to lbs, then multiply by .45 to get to kg. This correct, seems right? Quote
hjhjhgjgjh Posted December 8, 2009 Report Posted December 8, 2009 i cant say if its correct but use the round function or you get like 683.944444444444444444 Quote
Administrators Nabeel Posted December 8, 2009 Author Administrators Report Posted December 8, 2009 Haha, yep, I will be Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.