The Regenstrief Unit Conversion Tool

Gunther Schadow

This Java applet is a demonstration of the Java classes that provide a semantic key to units of measures. The syntax for units of measures is based on the standard ISO 2955. ISO 2955 is tailored to an ASCII character set without requiring special characters. It is easy to input ISO 2955 units on a computer keyboard. One somewhat odd behavior inherited from ISO 2955 is that the period in unit terms is not a decimal point but a multiplication operator.

You can select different standard codes for units using the choice box. In order to see what unit symbols are defined by these codes, you can browse the source definition files that are loaded by the applet. These are simple ASCII files that define prefices, base units and derived units.

Being a demonstration tool, this converter is not streamlined for routine use although I find it quite convenient. The limitations in terms of user friendlyness are:

  • Allowing to select different codes for units is not necessary, even confusing for routine use.
  • Only one of the 11 selectable codes is useful in my oppinion, i.e. the one I compiled without strict adherence to a standard. This does not mean that units are not standardizable, but the available standards ISO 2955 and ANSI X3.50 are bad.
  • Three of the 11 selectable codes won't even load, because they have errors. This demonstrates that the respective ISO and ANSI standards contain fatal name conflicts.
I strongly recommend to browse the table of known units before using it the first time, as it gives a hint on which units are defined and what their proper abbreviation is. This converter usually has only one abbreviation symbol for each unit, i.e. you can't say `gs', `gram', `gm', and `gms' for gram, the only allowed symbol for gram is `g'. Unfortunately the tables do not come in a nice HTML markup but in a simple computer readable format. Comments start with a pound sign `#'. On each non-empty line we find:
  1. The keywords `case' followed by `sensitive' or `insensitive'. to set the respective behavior of the parser.
  2. The keyword `dimensions' followed by the number of base units.
  3. The keyword `base', followed by a sequence of characters that make up the symbol of the base unit.
  4. A line starting with any other sequence of characters is a definition of a derived unit symbol. The symbol to be defined is followed by an equal sign `=' a value and a term of known units.

By default, my comprehensive table of units is used. This defines all units from SI, ISO 1000, plus a wide range of U.S. and British customary units, including, but not limited to ANSI X3.50. Customary units are usually written in square brackets, in order to avoid name conflicts. A conflict summary is appended to each table as comments. Learn more about name conflicts here.

 The Regenstrief Unit Conversion Tool
Copyright (c) 1998, the Regenstrief Institute. All rights reserved.
NO WARRANTY, WHETHER EXPRESSED OR IMPLIED.
1 Enter a measurements value, its unit, and the unit you want to convert to. Press the ``OK'' button.
2 You can select the code tables using the choice menu on the right.
3 Atomic units are those listed in the code table.
4 Simple units are atomic units with an optional prefix. Prefices are listed in the code table as well. Note that only those unit atoms marked as ``metric'' may be prefixed.
5 Simple units can be raised to a power by appending the integer exponent to the unit symbol. The number may be preceded by a `+' or `-' sign.
6 Units can be multiplied or devided using the operators `/' or `.' (period).
7 Positive integer numbers (without `+' sign) can occur in place of simple units. Prefices may not appear alone or before a number.
8 Parentheses can be used to nest terms, e.g., ``ml/(8.h)'' or ``ft/12'' are well-formed terms.
9 Do not use spaces inside unit terms.
Browse the unit tables here:
strict SI Units according to ISO 1000
full ISO 1000
ISO 2955 case sensitive
ISO 2955 case sensitive (fixed)
ISO 2955 case insensitive
ANSI X 3.50 case sensitive
ANSI X 3.50 case sensitive (fixed)
ANSI X 3.50 case insensitive
ANSI X 3.50 case insensitive (fixed)
HL7 ISO+
HL7 ANSI+
HL7 ISO+ANSI+
The Unified Code for Units of Measure - case sensitive
The Unified Code for Units of Measure - case insenitive
Gunther Schadow's comprehensive units (obsolete)

Documentation and Source Code

A draft version of an Article describing the idea.

The complete specification of the Unified Code for Units of Measure that is driving this applet.

The units classes for use in your own Java programs: units.zip.

JAVA units API documentation (still a bit terse, though).

The GPL copyrighted source code in tar gzip or ZIP

You may also browse the source code here .

There is code for an an older Unit Converter written in C++, but the service is no longer offered here.