MPG

Section: Misc. Reference Manual Pages (1L)
Updated: Local
Index Return to Main Contents
 

NAME

mpg, usmpg, ukmpg, eurmpg - Miles Per Gallon, A Fuel Economy Calculator  

SYNOPSIS

mpg  

DESCRIPTION

Mpg is a fuel economy calculator, i.e. it calculates fuel consumption statistics for a motor vehicle.

The program displays its results on the terminal screen, and optionally will produce a short statement on the standard line printer.

There are three versions of the program, based on the fact that there are three (or rather, two and one half) systems of measurement commonly used to measure distance travelled and fuel consumed.

USMPG is the American version of the program, requesting input in miles and US gallons.

UKMPG is the British version of the program, requesting input in miles and Imperial gallons. Obviously, it is useful anywhere where this combination of measurements is used.

EURMPG is the European or Decimal version of the program, requesting input in kilometers and liters. It is useful wherever the metric system has been fully implemented.

All three versions of the program print their results both for the current tank filling, and for the average from the first time a particular user used the program (old data for this purpose is kept in a file in the user's home directory.

All three versions print their results in three different formats:

-  Miles per US Gallon
-  Miles per Imperial Gallon
-  Liters per 100 Kilometers

which to my knowledge covers all common conventions to measure fuel efficiency.

The datafile $HOME/.mpgdata contains the total figures since the first time a particular user used the program, in the form of a single line of text. This line consists of five colon-delimited fields which contain the total miles, kilometers, US gallons, UK gallons, and liters. Here is a sample of the $HOME/.mpgdata file:

    598.35:957.36:21.50:18.15:81.71
       |      |     |     |     |
    miles     |  US Gall. |   Liters
                 kilometers     UK Gall.
 

INSTALLATION

Make sure the floating point arithmetic commands (fpdivide.1) are available. Copy the shell scripts for the three versions to your local bin directory, and make an additional link mpg to the version you will most frequently use. Copy the file mpgdata to $HOME/.mpgdata for every user who will use the program. The file is compatible with all versions of the program, so the versions can be used alternatively with no modification to #HOME/.mpgdata necessary.  

FILES

$HOME/.mpgdata the datafile
 

AUTHOR

Wolf N. Paul (ihnp4!killer!wnp)
Released to the Public Domain Jan 18, 1988


 

Index

NAME
SYNOPSIS
DESCRIPTION
INSTALLATION
FILES
AUTHOR

This document was created by man2html, using the manual pages.
Time: 07:02:53 GMT, December 12, 2024