Unit Representation

This page discusses how units are represented as strings. There is also a table of standard prefixes, and a table of built in units. This information applies to both the Java Library and the PalmOS application.

You may use a combination of any of the standard units, including standard prefixes. Strings are case sensitive mm is millimeter, Mm is megameter, and MM will generate an error.

Each unit is made up of a fraction of other units. Everything to the left of the slash is in the numerator and everything to the right is in the denominator -- parenthesis are not used (it's a feature...). Multiplication is just denoted by whitespace, and the exponent symbol is a caret: "^". Exponents may be positive or negative, but they must be integers. For example the unit kW/m^2 is the same as 1715 times the unit BTU/h ft^2.

The common temperature units, Centigrade or Celsius (°C) and Fahrenheit (°F), have an offset when compared to the default Kelvin (K). For this software, changes in temperature should use an absolute scale, such as Kelvin (K) or Rankine (R). In this software, 20 C - 10 C = 10 K. But 10 K = -263 C. So in this software, if we just subtract 20 C - 10 C, we would get -263 C. The bottom line is that we should not use Celsius or Fahrenheit when adding or subtracting, and probably not when multiplying or dividing.

Any unit may be preceded by a prefix to denote a multiplier. For example, one "dain" would be 10 inches.
Standard Prefixes
Prefix used in code Prefix for written unit Multiplier
da- deka- or deca- 10
h- hecto- 100
k- kilo- 1000
M- mega- 1e6
G- giga- 1e9
T- tera- 1e12
P- peta- 1e15
E- exa- 1e18
Z- zeta- 1e21
Y- yotta- 1e24
d- deci- 1e-1
c- centi- 1e-2
m- milli- 1e-3
mu- micro- 1e-6
n- nano- 1e-9
p- pico- 1e-12
f- femto- 1e-15
a- atto- 1e-18
z- zepto- 1e-21
y- yocto- 1e-24


Built In Units
Unit Symbol Definition Comments
Time
second sec 1 s  
minute min 60 s  
hour hr 60 min  
hour hour 1 hr alternate symbol
hour h 1 hr alternate symbol
day day 24 hr  
shake shake 10 ns  
Hertz Hz 1 s^-1  
week week 7 day  
fortnight fortnight 14 day  
work week week_wk 40 hour  
month month 30 day This is just for rough estimates, but I find it useful.
standard year year_std 365 day This is not to be used in astronomical computations.
Length or Distance
international foot ft 0.3048 m  
inch in 1.0/12.0 ft  
international mile mile 5280.0 ft  
international mile mi 1 mile alternate symbol
nautical mile nmi 1852 m  
milli-inch mil 0.001 in  
micron micron 1e-6 m  
Parsec pc 3.085678e16 m  
League league 3 mile  
Astronomical Unit ua 1.49598e11 m  
Astronomical Unit AU 1.49598e11 m alternate symbol
yard yd 3 ft  
Angstrom Ang 1e-10 m (I call it Ang, because I can't spell Å in java)
Angstrom \\AA 1 Ang alternate symbol
furlong furlong 220 yd  
fathom fathom 6 ft (my dad is sea foam)
Rod rd 16.5 ft  
U.S. survey foot sft (1200./3937.) m  
U.S. survey mile smi 5280 sft also called statue mile
cubit cubit 18 in rough approximation
point pt 1./72. in Typeface Point
pica pica 1./6. in Typeface Pica
Temperature
Celsius C 1 K -273.15  
Rankine R 5.0/9.0 K  
Fahrenheit F 1 R -459.67  
Mass
gram g 0.001 kg This is case sensitive.
gram gm g (alternate symbol)
pound mass lbm 0.45359237 kg (avoirdupois)
slug slug 1 lb sec^2/ft  
snail snail 1 lb sec^2/in  
Ounce oz 1.0/16.0 lbm (avoirdupois)
dram dram 1.0/16.0 oz (avoirdupois) Dram is short for drachm
Short Ton ton 2000 lbm  
Long Ton ton_l 2240 lbm  
Pennyweight dwt 24 gr (troy)
Troy ounce ozt 480 gr (apothecary)
Troy pound lbt 5760 gr (apothecary)
carat (metric) carat 0.2 g  
Grain gr 1.0/7000.0 lbm  
Stone stone 14 lbm  
Hundredweight cwt 8 stone  
Force or Weight
Newton N 1 kg m/s^2  
Dyne dyn 1e-5 N  
pound force lb lbm G  
pound force lbf lbm G  
poundal poundal 1 lbm ft/sec^2  
kilopound kip 1000 lbf  
kilogram force kgf kg G  
Energy
Joule J 1 N m  
British Therm. Unit BTU 1055.056 J (International Table)
British Therm. Unit Btu 1 BTU alternate symbol
British Therm. Unit BTU_th 1054.350 J (Thermochemical)
calorie cal 4.1868 J (International Table)
calorie cal_th 4.184 J (Thermochemical)
Calorie Cal 1 kcal (nutritionists)
electron volt eV 1.602177e-19 J  
erg erg 1e-7 J  
Ton of TNT TNT 4.184e9 J  
Power
Watt W 1 J/s  
Horse Power hp 550 ft lb/s  
Pressure
bar bar 1e5 N/m^2  
Pascal Pa 1 N/m^2  
Pounds per sq. inch psi 1 lb/in^2  
Pounds per sq. ft. psf 1 lb/ft^2  
kilo psi ksi 1000.0 psi  
atmospheres atm 1.01325e5 N/m^2  
millimeters Mercury mmHg 1.0/760.0 atm Pressure needed to raise a column of mercury 1 mm.
inches of Mercury inHg 1 mmHg in/mm  
Torr torr 1 mmHg Used in the Torricelli barometer
Volume or Area
Liter L 1/1000.0 m^3  
Pint (U.S. dry) dpint 0.5506105 L  
Quart (U.S. dry) dqt 2 dpint  
Acre acre 1/640.0 mi^2  
Hectare ha 10000 m^2  
Barrel (petroleum) barrel 158.9873 L  
Peck (U.S.) pk 8.809768 L  
Teaspoon tsp 1/768. gal  
Tablespoon tbl 3 tsp  
Fluid Ounce oz_fl 2 tbl  
Gill (U.S.) gi 8 tbl  
Cup cup 16 tbl  
Pint (U.S. liquid) pint 2 cup  
Quart (U.S. liquid) qt 2 pint  
gallon gal 3.785412 L  
firkin firkin 9 gal  
hogshead hogshead 63 gal  
Electromagnetism
Coulomb Co 1 A s Electric Charge
Volt V 1 W/A Electric Potential
Ohm ohm 1 V/A Electric Resistance
Ohm \\Omega 1 V/A alternate symbol
Faraday faraday 96485.31 Co Electric Charge
Farad farad Co/V Capacitance
Stokes stokes 1e-4 m^2/s  
Oersted Oe 79.57747 A/m  
Webber Wb V s Magnetic flux
Tesla Tesla Wb/m^2 Magnetic flux density
Henry H Wb/A Inductance
Siemens S A/V Electrical Conductance
Light and Radiation
Lux lux cd/m^2 Iluminance
Lux lx cd/m^2  
Lumen lm cd Luminous Flux
Stilb sb 10000 cd/m^2  
Phot ph 10000 lx  
Becquerel Bq s^-1 activity
Gray Gy J/kg Absorbed Dose, kerma
Sievert Sv J/kg Dose equivalent
Other Quantities
pound mole lbmole 1 mol lbm/g quantity
gram mole gmole 1 mol g/g quantity
poise poise 1 g /sec cm viscocity
Gravity's accel. G 9.80665 m/sec^2 Gravity on Earth
Galileo Gal 1 cm/sec^2 Used in Geology, when measuring gravity.
Degree deg Pi/180 Can be used to convert from degrees to radians for trig functions.
radian rad 1 Actually, radian is a pure number.
steradian st 1 The unit surface area of a unit sphere. It is really a pure number.
Percent % 0.01  
Knot knot 1 nmi/hr velocity
Miles per Hour mph 1 mi/hr velocity
Gallon/minute gpm 1. gal/min flow rate
Revolution/minute rpm 360 deg/min  
Obscure
ch'ih chih 10.0/33.0 m Chinese
feddan feddan 1.038 acre Egyptian
vara vera 0.84 m Nicaraguan
verst verst 1.067 km Russan
Humor
  1 million microphones 1 megaphone (it's a joke! Get it?)
  1 million bicycles 2 megacycles  
  2000 mockingbirds 2 kilomockingbirds  
  10 cards 1 decacards (or is it 52 cards = 1 deck-a-cards?)
  1/2 lavatory 1 demijohn  
  1 millionth of a fish 1 microfiche  
  453.6 graham crackers 1 pound cake  
  10 rations 1 decoration  
  1 ship 1 millihelen  
  10 millipedes 1 centipede  
  3-1/3 tridents 1 decadent  
  10 monologs 5 dialogues  
  2 monograms 1 diagram  
  8 nickles 2 paradigms  

Notice that lb is pound force. If you wish to use pound mass, you should use lbm.

Most of the conversion factors are taken from the U.S. National Institute of Standards and Technology, NIST. According to NIST, the BTU and calorie were redefined at the Fifth International Conference on the Properties of Steam (London, July 1956). These are marked as International Table above. An alternate definition is listed as "Thermochemical".

Internally, a unit is represented in terms of the primitive units: m (meters), s (seconds), kg (kilograms), K (Kelvin), mol (Moles), A (Amperes), and cd (candelas). Any unit can be represented as a product of powers of these primitive units. These units form the basis for the International Standard (SI) system.


Main Unit Page --- Fred Gylys-Colwell Last Revised: January 23, 2005 --- project page