Units (software)

From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search

Units is a cross-platform computer program for conversion of units of quantities. It has a database of measurements, including esoteric and historical measurements. This for instance allows conversion of velocities specified in furlongs per fortnight, and pressures specified in tons per acre. The plain text database units.dat is a good reference in itself, as it is extensively commented and cites numerous sources.

The original units program has been a standard part of Unix since the early Bell Laboratories versions.[citation needed]

UDUNITS is a similar utility program, except that it has an additional programming library interface and date conversion abilities. UDUNITS is considered the de facto program and library for variable unit conversion for netCDF files.[1]

The relatively newer GNU free software version of units (or GNU Units) is written by Adrian Mariano.



Units will output the result of the conversion in two lines. Usually the first line (multiplication) is the desired result. The second line is the same conversion expressed as a division.

Units can also do math while converting, including several built in mathematical functions such as sin, cos, atan, log, exp, etc.

If you attempt to convert types of measurements that are incompatible units will print a conformability error message and display a reduced form of each measurement.


Interactive mode

2083 units, 71 prefixes, 32 nonlinear units
You have: 10 furlongs
You want: miles
        * 1.2500025
        / 0.7999984
You have: 1 gallon + 3 pints
You want: quarts
        * 5.5
        / 0.18181818
You have: sqrt(miles^2)
You want:
        Definition: 1609.344 m
You have:

On the command line (non-interactive)

% units 'ten furlongs per fortnight' 'kilometers per hour'
        * 0.0059871548
        / 167.02424
% units cup ounces
conformability error
        0.00023658824 m^3
        0.028349523 kg


  1. As specified from several NetCDF conventions, e.g.:

External links

Personal tools

Served in 0.147 secs.