Class Index | File Index

Classes


Class VolumeUnit


Extends Measurement.
Create a new Volume measurement instance.
Defined in: VolumeUnit.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
VolumeUnit(options)
Method Summary
Method Attributes Method Name and Description
<static>  
VolumeUnit.convert(to, from, volume)
Convert a volume to another measure.
 
Return the type of this measurement.
 
newUnit(params)
Return a new instance of this type of measurement.
Class Detail
VolumeUnit(options)
Parameters:
options
{{unit:string,amount:number|string|undefined}} Options controlling the construction of this instance
Method Detail
<static> {number|undefined} VolumeUnit.convert(to, from, volume)
Convert a volume to another measure.
Parameters:
to
{string} unit to convert to
from
{string} unit to convert from
volume
{number} amount to be convert
Returns:
{number|undefined} the converted amount

{string} getMeasure()
Return the type of this measurement. Examples are "mass", "length", "speed", etc. Measurements can only be converted to measurements of the same type.

The type of the units is determined automatically from the units. For example, the unit "grams" is type "mass". Use the static call Measurement.getAvailableUnits to find out what units this version of ilib supports.

Returns:
{string} the name of the type of this measurement

{Measurement} newUnit(params)
Return a new instance of this type of measurement.
Parameters:
{Object} params
parameters to the constructor
Returns:
{Measurement} a measurement subclass instance

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Jan 17 2023 15:56:28 GMT-0800 (Pacific Standard Time)