recalculateToLastSavedUOM method

double? recalculateToLastSavedUOM({
  1. UnitOfMeasuresDto? currentUOM,
  2. double quantity = 0,
})

Implementation

double? recalculateToLastSavedUOM({
  UnitOfMeasuresDto? currentUOM,
  double quantity = 0,
}) {
  if (currentUOM == null) return null;

  return double.tryParse(
    currentUOM
        .convertQuantity(newUnit: currentUOM, value: quantity)
        .toStringAsFixed(3),
  );
}