convert/conversion_table
convert a list of units into a conversion table
Calling Sequence
Parameters
Description
Examples
convert([L1, L2], conversion_table, opts)
convert(L, conversion_table, opts)
L1, L2, L
-
lists of symbols; unit names or symbols
opts
(optional) equation(s) of the form option=value where option is one of energy, filter, order, output, or symbolic; specify options for the conversion
The convert([L1, L2], conversion_table) function creates a table indexed by the cartesian product of the lists L1 and L2 where the entries are the conversion factors from the first index to the second.
The convert(L, conversion_table) function is a short form for convert([L, L], conversion_table).
When a conversion factor cannot be found between two valid units, the entry in the table is FAIL.
You can modify the properties of the conversion by including options opts. The opts argument can contain one or more of the following equations.
energy = true or false
This option is passed as an option to the convert/units routine. If this option is set to true, the conversion can be between energy units, not only units with the same dimension. See Energy Conversions. The default value is false.
filter = anything
This option is a filter applied to the conversion factors. For example, filter=evalf5 evaluates all conversion factors to five digit floating-point numbers.
order =lexorder or a procedure
This option specifies the order in which names should be listed. The order can be specified by a procedure or be the lexicographical order (see sort). The value of this option determines the output order only for output=grid or columns.
output = table, grid, columns
By default, output=table. The output is a table as described above.
If this option is set to grid, a formatted table is returned with unit names and unit symbols of the list L1 in the first two columns, and unit symbols of the list L2 (where available) in the first row.
If this option is set to columns, a formatted table is returned. In the first column, the unit names from L1 are listed in order. For each entry in the first column, an entry in the second column appears for each unit in L2 for which a conversion exists along with conversion factor in the third column.
symbolic = `true` or `false`
This option is passed to the convert/units function as an option. The default value is false.
L≔newton,gf,pond,sthene,dyne,ozf,lbf,tonforce,poundal,kipf:
A≔convert⁡L,conversion_table:
Anewton,gf
20000000196133
Adyne,ozf
3200000008896443230521
convert⁡N,poundal,lbf,conversion_table,output=grid,filter=evalf4
To:NpoundalslbfUnit NameSymbolnewtonsN 1.7.2330.2248poundals 0.13831.0.03108poundsforcelbf 4.44832.171.
convert⁡W,hp,poncelet,abW,statW,ergs,W,hp,ergs,conversion_table,output=grid,filter=evalf4,order=lexorder
To:ergshpWUnit NameSymbolergs per secondergs 1.1.341×10−101.×10−7abwattsabW 1.1.341×10−101.×10−7horsepowershp 7.457×1091.745.7poncelets 9.807×1091.315980.7statwattsstatW 1.1.341×10−101.×10−7wattsW 1.×1070.0013411.
convert⁡mm,cm,dm,m,conversion_table,output=grid
To:mmcmdmmUnit NameSymbolmillimetersmm 1110110011000centimeterscm 1011101100decimetersdm 100101110metersm 1000100101
convert⁡1m,Jmol,E0,1s,kg,cal,kg,Jmol,conversion_table,output=grid,energy,filter=evalf4
To:kgJmolUnit NameSymbol1 per meter1m 2.21×10−420.1196joules per moleJmol 1.848×10−411.hartreesE0 4.851×10−352.625×1061 per second1s 7.372×10−513.99×10−10kilogramskg 1.5.412×1040caloriescal 4.655×10−172.52×1024
convert⁡UnitsGetUnits⁡dimension=force,conversion_table,output=columns,energy,filter=evalf4
Units From:Units To:Conversion Factor:dynesgf0.00102kip2.248×10−9kipf2.248×10−9N0.00001ozf0.00003597planck_force8.262×10−50pond0.00102poundal0.00007233lbf2.248×10−6sn1.×10−8tonf1.124×10−9gramsforcedyn980.7kip2.205×10−6kipf2.205×10−6N0.009807ozf0.03527planck_force8.103×10−47pond1.poundal0.07093lbf0.002205sn9.807×10−6tonf1.102×10−6kipsdyn4.448×108gf453600.kipf1.N4448.ozf16000.planck_force3.675×10−41pond453600.poundal32170.lbf1000.sn4.448tonf0.5kipfdyn4.448×108gf453600.kip1.N4448.ozf16000.planck_force3.675×10−41pond453600.poundal32170.lbf1000.sn4.448tonf0.5newtonsdyn100000.gf102.kip0.0002248kipf0.0002248ozf3.597planck_force8.262×10−45pond102.poundal7.233lbf0.2248sn0.001tonf0.0001124ouncesforcedyn27800.gf28.35kip0.0000625kipf0.0000625N0.278planck_force2.297×10−45pond28.35poundal2.011lbf0.0625sn0.000278tonf0.00003125planck forcesdyn1.21×1049gf1.234×1046kip2.721×1040kipf2.721×1040N1.21×1044ozf4.353×1044pond1.234×1046poundal8.754×1044lbf2.721×1043sn1.21×1041tonf1.36×1040pondsdyn980.7gf1.kip2.205×10−6kipf2.205×10−6N0.009807ozf0.03527planck_force8.103×10−47poundal0.07093lbf0.002205sn9.807×10−6tonf1.102×10−6poundalsdyn13830.gf14.1kip0.00003108kipf0.00003108N0.1383ozf0.4973planck_force1.142×10−45pond14.1lbf0.03108sn0.0001383tonf0.00001554poundsforcedyn444800.gf453.6kip0.001kipf0.001N4.448ozf16.planck_force3.675×10−44pond453.6poundal32.17sn0.004448tonf0.0005sthenedyn1.×108gf102000.kip0.2248kipf0.2248N1000.ozf3597.planck_force8.262×10−42pond102000.poundal7233.lbf224.8tonf0.1124tonsforcedyn8.896×108gf907200.kip2.kipf2.N8896.ozf32000.planck_force7.351×10−41pond907200.poundal64350.lbf2000.sn8.896
See Also
convert
convert/dimensions
convert/unit_free
convert/units
Energy Conversions
evalf
FAIL
sort
Units
Units/Index
Download Help Document