The Unidata units library (UDUNITS-1) supports conversion of unit specifications between formatted and binary forms, arithmetic manipulation of unit specifications, and conversion of values between compatible scales of measurement.
A unit is the amount by which a physical quantity is measured. For example:
|Physical Quantity||Possible Unit|
The UDUNITS-1 package also contains an interactive utility, udunits, which has two modes. In one mode, both an input and output unit specification are given, causing the utility to print the conversion between them:
You have: inch You want: cm cm = inch*2.54 cm = inch/0.393701 You have: (15 lbs force/in)^2 You want: atm2 atm2 = (15 lbs force/in)^2*0.995719 atm2 = (15 lbs force/in)^2/1.0043 You have: celsius You want: fahrenheit fahrenheit = celsius*1.8 + 32 fahrenheit = celsius/0.555556 + 32
In the other mode, only an input unit specification is given. This causes the utility to print the definition -- in standard units -- of the input unit:
You have: fahrenheit You want: Definition: "0.555556 kelvin @ 255.372" You have: geopotential meters You want: Definition: "9.80665 meter2 second-2"
See the UDUNITS-1 RELEASE NOTES file for a list of changed between versions.
View the Supported Units for UDUNITS-1.
Further information on the UDUNITS-1 package can be found in the following man pages:
Copyright 2023 University Corporation for Atmospheric Research and contributors. All rights reserved.
This software was developed by the Unidata Program Center of the University Corporation for Atmospheric Research (UCAR) https://www.unidata.ucar.edu.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.