12 .Op Ar from-unit to-unit
14 The following options are available:
15 .Bl -tag -width indent
16 .It Fl h No , Fl -help
17 Show an overview of options
18 .It Fl f Ar filename No , Fl -file Ar filename
19 Specify the name of the units data file to load.
20 .It Fl e , Fl -exponential
21 Behave as if -o '%6e' was typed.
22 .It Fl q No , Fl -quiet
23 Suppress prompting of the user for units and the display of statistics
24 about the number of units loaded.
25 .It Fl U No , Fl -unitsfile
26 If the default unit file exists prints its location.
29 Units data file not found
31 .It Fl t No , Fl -terse
32 Only print the result. This is used when calling
34 from other programs for easy to parse results.
35 .It Fl v No , Fl -verbose
36 Print the units in the conversion output.
37 Be more verbose in general.
38 .It Fl o Ar format No , Fl -output-format Ar format
39 Select the output format string by which numbers are printed.
40 .It Fl V No , Fl -version
41 Print the version number, usage, and then exit.
42 .It Ar from-unit to-unit
43 Allow a single unit conversion to be done directly from the command
45 The program will not print prompts.
47 result of the single specified conversion.
52 program converts quantities expressed in various scales to
53 their equivalents in other scales.
57 handle multiplicative or affine scale changes.
58 It works interactively by prompting
72 You want: furlongs/fortnight
86 Powers of units can be specified using the '^' character as shown in
87 the example, or by simple concatenation: 'cm3' is equivalent to 'cm^3'.
88 Multiplication of units can be specified by using spaces, a dash or
90 Division of units is indicated by the slash ('/').
91 Note that multiplication has a higher precedence than division,
92 so 'm/s/s' is the same as 'm/s^2' or 'm/s s'.
94 must be indicated using the vertical bar ('|').
96 meter, you would write '1|2 meter'.
97 If you write '1/2 meter' then the
98 units program would interpret that as equivalent to '0.5/meter'.
99 If you enter incompatible unit types, the units program will
100 print a message indicating that the units are not conformable and
101 it will display the reduced form for each unit:
104 You want: fathoms kg^2 / day
106 2.7777778e-11 kg m^2 / sec^3
107 2.1166667e-05 kg^2 m / sec
110 The conversion information is read from a units data file.
112 file includes definitions for most familiar units, abbreviations and
114 Some constants of nature included are:
116 .Bl -column -offset indent -compact "mercury"
117 .It "pi ratio of circumference to diameter"
118 .It "c speed of light"
119 .It "e charge on an electron"
120 .It "g acceleration of gravity"
121 .It "force same as g"
122 .It "mole Avogadro's number"
123 .It "water pressure per unit height of water"
124 .It "mercury pressure per unit height of mercury"
125 .It "au astronomical unit"
128 The unit 'pound' is a unit of mass.
129 Compound names are run together
130 so 'pound force' is a unit of force.
131 The unit 'ounce' is also a unit
133 The fluid ounce is 'floz'.
134 British units that differ from
135 their US counterparts are prefixed with 'br', and currency is prefixed
136 with its country name: 'belgiumfranc', 'britainpound'.
138 for a unit, if the specified string does not appear exactly as a unit
141 will try to remove a trailing 's' or a
142 trailing 'es' and check again for a match.
144 To find out what units are available read the standard units file.
145 If you want to add your own units you can supply your own file.
146 A unit is specified on a single line by
147 giving its name and an equivalence.
149 new units in terms of old ones so that a reduction leads to the
150 primitive units which are marked with '!' characters.
153 program will not detect infinite loops that could be caused
154 by careless unit definitions.
155 Comments in the unit definition file
156 begin with a '#' or '/' character at the beginning of a line.
158 Prefixes are defined in the same was as standard units, but with
159 a trailing dash at the end of the prefix name.
160 If a unit is not found
161 even after removing trailing 's' or 'es', then it will be checked
162 against the list of prefixes.
163 Prefixes will be removed until a legal
164 base unit is identified.
166 Here is an example of a short units file that defines some basic
169 .Bl -column -offset indent -compact "minute"
180 .Bl -tag -width /usr/share/misc/units.lib -compact
181 .It Pa /usr/share/misc/units.lib
182 the standard units library
185 .An Adrian Mariano Aq Mt adrian@cam.cornell.edu
187 The effect of including a '/' in a prefix is surprising.
189 Exponents entered by the user can be only one digit.
190 You can work around this by multiplying several terms.
192 The user must use | to indicate division of numbers and / to
193 indicate division of symbols.
194 This distinction should not
197 The program contains various arbitrary limits on the length
198 of the units converted and on the length of the data file.
200 The program should use a hash table to store units so that
201 it does not take so long to load the units list and check