toUnit method

double toUnit(
  1. BinaryPrefix to, [
  2. BinaryPrefix from = BinaryPrefix.none
])

Implementation

double toUnit(BinaryPrefix to, [BinaryPrefix from = BinaryPrefix.none]) {
  if (from == to) return toDouble();
  final withoutPrefix = from.factor.toDouble() * this;
  return withoutPrefix / to.factor.toDouble();
}