All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ucar.units.package.html Maven / Gradle / Ivy

Go to download

The NetCDF-Java Library is a Java interface to NetCDF files, as well as to many other types of scientific data formats.

There is a newer version: 4.3.22
Show newest version



   
   


Provides support for parsing and formatting string unit specification,
converting numerical values between compatible units, and performing arithmetic
on units (such as dividing one unit by another).

Examples of Intended Use

The following code will print the string "5 knots is 2.57222 m/s":
UnitFormat format = UnitFormatManager.instance();
Unit meter = format.parse("meter");
Unit second = format.parse("second");
Unit meterPerSecondUnit = meter.divideBy(second);
Unit knot = format.parse("knot");
if (meterPerSecondUnit.isCompatible(knot) {
    System.out.println("5 knots is " +
        knot.convertTo(5, meterPerSecondUnit) +
        ' ' + format.format(meterPerSecondUnit));
}
 




© 2015 - 2024 Weber Informatics LLC | Privacy Policy