to method
Implementation
double to(final LengthUnit unit, final double value) {
if (unit.scaleFactor == scaleFactor) {
return value;
}
// Convert to primary unit.
final primaryValue = value / scaleFactor;
// Convert to destination unit.
return primaryValue * unit.scaleFactor;
}