valueTo method

num valueTo(
  1. num val,
  2. Unit<D> other
)

Converts val from this unit to other.

Implementation

num valueTo(num val, Unit<D> other) {
  if (other == this) return val;
  if (!isCompatible(other)) throw UnsupportedError('$symbol and ${other.symbol} are incompatible');

  return converterTo(other).apply(val);
}