convertUnits method

double convertUnits(
  1. double value,
  2. int from,
  3. int to
)

Converts units.

Implementation

double convertUnits(double value, int from, int to) {
  return (from == to)
      ? value
      : value * _unitsProportions[from] / _unitsProportions[to];
}