UnitConvertor.convert

Converts a given value from in unit to out unit

More...
  1. LinearFunction convert(string inUnit, string outUnit)
  2. double convert(double value, string inUnit, string outUnit, double defaultValue)
    class UnitConvertor
    const
    double
    convert
    (
    double value
    ,
    string inUnit
    ,
    string outUnit
    ,
    double defaultValue = double.nan
    )

Parameters

value double

value to convert

inUnit string

unit to convert from

outUnit string

unit to convert to

defaultValue double

value to return if conversion fails

Return Value

Type: double

value converted to out unit

Detailed Description

Supports aliases for unit names, see AliasDictionary

Meta