convert method
Implementation
num convert(num value, Unit<T> from, Unit<T> to) {
num result = value;
List<ConversionNode<T>> rootFromUnitPath = [];
List<ConversionNode<T>> rootToUnitPath = [];
if (_hasPath(tree.data, from, rootFromUnitPath) &&
_hasPath(tree.data, to, rootToUnitPath)) {
_trimToLowestCommonAncestor(rootFromUnitPath, rootToUnitPath);
result = count(result, rootFromUnitPath.reversed.toList());
result = count(result, rootToUnitPath);
}
return result;
}