View Single Post
Old 08-30-2010, 09:40 PM   #956 (permalink)
nickdigger
EcoModding Apprentice
 
Join Date: Aug 2009
Location: terra firma
Posts: 138
Thanks: 4
Thanked 24 Times in 22 Posts
unsigned long gallonsRemain ()
{ signed long rem = parms[tankSizeIdx] - tank.gallons();
return (rem<0 ? 0 : rem);
}

unsigned long milesRemain ()
{ return gallonsRemain() * tank.mpg() / 1000; }

/* something like that. i dunno. i don't use 0.86, so i haven't tested the code.
how/where to display this figure is up to you. */
  Reply With Quote