CONVERT

Syntax:

CONVERT ( number , from-unit , to-unit )

Description: Converts a number from one measurement system to another.

Arguments:

Name

Type

Description

number

number

The value to be converted from from-units to to-units.

from-unit

text

The unit to be converted from, where the valid string values are shown in the tables below.

to-unit

text

The unit to be converted to, where the valid string values are shown in the tables below.

Weight and Mass

Unit String

Meaning

g

Gram

lbm

Pound mass (avoirdupois)

ozm

Ounce mass (avoirdupois)

sg

Slug

u

U (atomic mass unit)

Distance

Unit String

Meaning

ang

Angstrom

ft

Foot

in

Inch

m

Meter

mi

Statute mile

Nmi

Nautical mile

Pica

Pica (1/72 inch)

yd

Yard

Time

Unit String

Meaning

day

Day

hr

Hour

mn

Minute

sec

Second

yr

Year

Pressure

Unit String

Meaning

at or atm

Atmosphere

mmHg

mm of Mercury

P or p

Pascal

Force

Unit String

Meaning

dy or dyn

Dyne

lbf

Pound force

N

Energy

Unit String

Meaning

BTU or btu

BTU

c

Thermodynamic calorie

cal

IT calorie

e

Erg

ev or eV

Electron volt

flb

Foot-pound

HPh or hh

Horsepower-hour

J

Joule

Wh or wh

Watt-hour

Power

Unit String

Meaning

H or hp

Horsepower

W or w

Watt

Magnetism

Unit String

Meaning

ga

Gauss

T

Tesla

Temperature

Unit String

Meaning

C or cel

Degrees Celsius

F or fah

Degrees Fahrenheit

K or kel

Degrees Kelvin

Liquid Measure

Unit String

Meaning

cup

Cup

gal

Gallon

l or lt

Liter

oz

Fluid ounce

ptor us_pt

pint

qt

Quart

tbs

Tablespoon

tsp

Teaspoon

uk_pt

pint

The following abbreviated unit prefixes can be used with any metric unit:

Abbreviated Unit Prefixes

Prefix String

Meaning

E

exa (1E+18)

P

peta (1E+15)

T

tera (1E+12)

G

giga (1E+09)

M

mega (1E+06)

k

kilo (1E+03)

h

hecto (1E+02)

e

dekao (1E+01)

d

deci (1E-01)

c

centi (1E-02)

m

milli (1E-03)

u

micro (1E-06)

n

nano 1E-09)

p

pico (1E-12)

f

femto (1E-15)

a

atto (1E-18)

Unit names and prefixes are case-sensitive.

Return Type and Value: number – The value of number in from-units converted to to-units.

However, if

  • The value of from-unit or to-unit is invalid, #N/A is returned.

  • The from-unit and to-unit are from different measurement categories, #N/A is returned.

  • The value of from-unit or to-unit has an abbreviated unit prefix, yet none is supported for that unit, #N/A is returned.

example: