convert function

double convert(
  1. Converter<num> from,
  2. Converter<num> to,
  3. num value
)

Converts the given value from the unit given by from to the target unit given by to.

Throws ArgumentError if its not possible to convert between the two units.

Implementation

double convert(Converter<num> from, Converter<num> to, num value) =>
    from(to, value.toDouble()).toDouble();