View Single Post
Old 08-11-2009, 11:47 PM   #12 (permalink)
cfg83
Pokémoderator
 
cfg83's Avatar
 
Join Date: Dec 2007
Location: Southern California
Posts: 5,864

1999 Saturn SW2 - '99 Saturn SW2 Wagon
Team Saturn
90 day: 40.49 mpg (US)
Thanks: 439
Thanked 532 Times in 358 Posts
SVOboy -

Ok. I don't think that equation is right. Here's what happens to me :

Code:
( $total_indy_gallons * ((100 + $epa)/100)) - $total_indy_gallons
=>
( $[827.08] * ((100 + $[27])/100)) - $[827.08]
=>
( $[827.08] * ((127/100)) - $[827.08]
=>
( $[827.08] * (1.27) - $[827.08]
=>
1050 - 827 
=>>>>>>>>>> 223
Now, assuming that "$total_indy_miles" exists as a variable *AND* $epa is not zero, I wrote this :

Code:
$saved_indy = 
round
( 
  (
   ( $total_indy_miles / $epa) - $total_indy_gallons
  ), 2
);
CarloSW2
__________________

What's your EPA MPG? Go Here and find out!
American Solar Energy Society
  Reply With Quote