convertQuantity method

double convertQuantity({
  1. required UnitOfMeasuresDto newUnit,
  2. required double value,
  3. bool removeZeros = false,
})

Implementation

double convertQuantity({
  required UnitOfMeasuresDto newUnit,
  required double value,
  bool removeZeros = false,
}) {
  double temp = value;
  temp *= numerator;
  temp /= denominator;
  temp /= newUnit.numerator;
  temp *= newUnit.denominator;
  return temp;
}